n = [] for i in range(10): print(i,i,i,i) x,y = input().split() if y != 4: n.add(i) m = [0] * 4 def dfs(s): if s == 4: print(' '.join(m)) x,y = map(int,input().split()) if x == 4 and y == 0: return True return False for i in n: m[s] = i if(dfs(s + 1)): return True m[s] = 0 return False dfs(0)