import sys from math import sqrt def debug(x, table): for name, val in table.items(): if x is val: print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr) return None def solve(): nums = [0]*10 i = 0 print(''.join(map(str, nums)), flush=True) X, gomi = input().split() if X == '10': return None X = int(X) pX = X nums[i] += 1 while 1: print(''.join(map(str, nums)), flush=True) X, gomi = input().split() if X == '10': return None X = int(X) if pX == X: nums[i] += 1 nums[i] %= 10 elif pX + 1 == X: i += 1 nums[i] += 1 nums[i] % 10 else: nums[i] -= 1 nums[i] % 10 pX = X if __name__ == '__main__': solve()