var A : array[0..6] of integer;
i : integer;
begin
for i:=0 to 6 do
read(A[i]);
Writeln(A[6],' ',A[5]);
Write(A[0],' ',A[1],' ',A[2],' ',A[3],' ',A[4]);
end.
var A : array[0..6] of integer;
i : integer;
begin
for i:=0 to 6 do
read(A[i]);
Writeln(A[6],' ',A[5]);
Write(A[0],' ',A[1],' ',A[2],' ',A[3],' ',A[4]);
end.