#!/usr/bin/env python3 import sys import random import itertools def query(a, b, c, d): print(a, b, c, d) sys.stdout.flush() x, y = map(int,input().split()) if x == 4 and y == 0: sys.exit(0) return x, y a = { 0, 1, 2, 3 } x, y = query(*a) while x + y < 4: u = random.choice(list(a)) v = random.choice(list(set(range(10)) - a)) b = (a - { u }) | { v } nx, ny = query(*b) if x + y < nx + ny: a, x, y = b, nx, ny for a in itertools.permutations(a): query(*a)