program project1;

uses Math;

var a:array of int64;
    i,j,x,n,y:int64;

begin
randomize;

read(n);
setlength(a,n);
for i:=1 to n do read(a[i]);

repeat
x:=random(n)+1;
y:=random(n)+1;
until not(x = y);

j:=a[x];
a[x]:=a[y];
a[y]:=j;

for i:=1 to n do write(a[i],' ');

end.