var i,a,m:word=2;s:string;begin repeat a:=257;s:="";repeat m:=a mod i;s:=chr(48+m+7*ord(m>9))+s;a:=a div i until a=0;writeln(s);inc(i)until i=37end.