program obrat;

procedure obr;
var a:integer;
begin
readln(a);
if a <> 0 then obr;
writeln(a);
end;

begin
obr;
end.
