Var
s, s1, sn: string;
i, n, p1, p2: integer;
begin
Readln(s);
p1 := Pos(' ', s) - 1;
n := Length(s);
i := n;
while s[i] <> ' ' do i := i - 1;
p2 := i + 1;
s1 := Copy(s, 1, p1);
sn := Copy(s, p2, n + 1 - p2);
s := sn + Copy(s, p1 + 1, p2 - p1 - 1) + s1;
Writeln(s)
end.