Unfortunately, there is no function in Pascal that would allow reading multiple space-separated lines from a single line. To do this, you have to write your own function:
vars, w: string;
i, j, ind: integer;
a: array of string;
begin
readln(s);
setlength(a, length(s));
i := 1;
ind := 0;
while i < length(s) do
begin
while (i < length(s)) and ('' + s[i] = ' ') do i += 1;
j := i + 1;
w := '' + s[i];
while (j < length(s)) and ('' +s[j] <> ' ') do begin
w += s[j];
j += 1;
end;
a[ind] := w;
ind += 1;
i := j;
end;
write(a[0], a[1]);
end.
As a result, we get an array of strings.