var
  n: integer;
  a: array[byte] of byte;
  i, j: byte;
 
begin
  i := 1;
  readln(n);
  while n > 0 do
  begin
    a[i] := n mod 10;
    inc(i);
    n := n div 10;
  end;
  j := i - 1;
  for i := j downto 1 do
    writeln(a[i]);
end.