Var i, n: integer; s, t: string; begin readln(s); s := ' ' + s; n := length(s); for i := length(s) downto 1 do if s[i] = ' ' then begin t := t + copy(s, i + 1, n) + ' '; n := 0; end else n := n + 1; writeln(t); end.