s=["0"]*10 for i in range(10): p=-1 q=0 for j in range(10): s[i]=str(j) print("".join(s)) np,l=input().split() np=int(np) if np==10: exit() if np>p: p=np q=j s[i]=str(q)