var n,i,p:integer;
  a:array[1..10000] of integer;

begin
  read(n);
  for i:=1 to n do
  read(a[i]);
  p:=a[1];
  a[1]:=a[2];
  a[2]:=p;
  readln;
  for i:= 1 to n do
  write(a[i],' ');
  readln;

end.