import sys n = [] for i in range(10): print(i,i,i,i) sys.stdout.flush() x,y = map(int,input().split()) if (x >= 1 and y != 0) or(x == 4 and y == 0): n.append(i) m = [0] * 4 def dfs(s): if s == 4: print(' '.join(map(str,m))) x,y = map(int,input().split()) if x == 4 and y == 0: sys.exit(0) return for i in n: m[s] = i dfs(s + 1) m[s] = 0 dfs(0)