procedure swap(var a,b:integer);
var c:integer;
  begin
    c:=a;
    a:=b;
    b:=c;
  end;
var n,i:integer;
    a:array[1..10000] of integer;
begin
  readln(n);
  for i:=1 to n do
  read(a[i]);
  swap(a[1],a[2]);
  readln;
  for i:= 1 to n do
  write(a[i],' ');
  end.