program pyy;var a:integer;procedure to8(n:integer);begin if n>=1 then to8(n div 8) else exit; write(n mod 8);end;begin readln(a); to8(a); readln;end.