import sys def out(nums): print "".join(map(str, nums)) sys.stdout.flush() n, mes = raw_input().split() return int(n) i = 0 nums = [0] * 10 fixed = 0 count = out(nums) while count < 10: nums[fixed] += 1 ans = out(nums) if ans < count: nums[fixed] -= 1 fixed += 1 elif ans > count: fixed += 1 count = ans