n = [] for i in range(10): print(i,i,i,i) x,y = map(int,input().split()) if x >= 1 and y != 4: 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: return True return False for i in n: m[s] = i if(dfs(s + 1)): return True m[s] = 0 return False dfs(0)