const
n=12
var
a:array [1..n] of integer;
i,k:integer;
begin
for i:=1 to n do readln(a[i]);
k:=a[1];
a[1]:=a[n];
a[n]:=k;
a[3]:=a[8];
for i:=1 to n do write (a[i],' ');
readln;
end.
const
n=12
var
a:array [1..n] of integer;
i,k:integer;
begin
for i:=1 to n do readln(a[i]);
k:=a[1];
a[1]:=a[n];
a[n]:=k;
a[3]:=a[8];
for i:=1 to n do write (a[i],' ');
readln;
end.