# -*- coding: utf-8 -*- import sys,copy,math,heapq,itertools as it,fractions,re,bisect,collections as coll cand = [] for i in xrange(10): print i, i, i, i sys.stdout.flush() X, Y = map(int, raw_input().split()) for j in xrange(Y): cand.append(i) for Ns in it.permutations(cand, 4): print " ".join(map(str, Ns)) sys.stdout.flush() X, Y = map(int, raw_input().split()) if X == 4: break