#import pdb; pdb.set_trace() import sys import copy def main(): a = ["0","0","0","0","0","0","0","0","0","0"] num = ["0","1","2","3","4","5","6","7","8","9"] f = ["" for i in range(10)] now = 0 for i in range(1, 10): print ("".join(a)) (x, z) = input().split() if x == "10": sys.exit() now = x for j in range(10): tmpa = copy.deepcopy(a) tmpa[j] = num[i] print ("".join(tmpa)) (x, z) = input().split() if x > now: a[j] = num[i] now = x if __name__ == '__main__': main()