for each(n in readline(s="0123456789"))putstr(x=s[n],s=x+s.replace(x,''))