Var b:integer;
a: array [0..5] of integer;
beginfor b:=0 to 5 do begin
read(a[b])
end;
for b:=5 downto 2 do begin
write(a[b],' ');
end;
writeln('');
for b:=0 to 1 do begin
write(a[b],' ');
end;
writeln('');
for b:=0 to 5 do begin
if (b=1) or (b=5) then write(a[b],' ');
end;
end