1
2
3
4
5
6
7
8
program tas; type Ti=longint; var n,t,i,mx:Ti;
  a:array[1..1050000] of Ti;
begin readln(n,t); i:=0; mx:=0;
  repeat i+=1; mx+=1; read(a[i]) until eoln;
  if odd(t) then for i:=mx downto 1 do write(a[i],' ')
  else for i:=1 to mx do write(a[i],' ');
  writeln
end.