I, N, M = map(int, input().split()) I -= 1 A = list(map(int, input().split())) history = {} def ask(n: int): print("ASK", n) def get_res(): s = input().split() a, b = map(int, s[1:]) if s[0] == "COUNT": history[a] = b return s[0] == "COUNT", a, b B = [] for i in range(N): if I == 0: assert input() == "TURN" ask(A[i]) get_res() assert input() == "WAIT" B.append(get_res()[1]) else: assert input() == "WAIT" B.append(get_res()[1]) assert input() == "TURN" ask(A[i]) get_res() n = N C = [] pend = list(range(1, M + 1)) def update(i): global n assert i in history if i in pend: pend.remove(i) k = history[i] - A.count(i) - B.count(i) n -= k C.extend([i] * k) for i in range(1, M + 1): if i not in history: continue update(i) t = 0 while True: if t ^ I == 0: assert input() == "TURN" if n == 0: C.sort() print("GUESS", *C) break x = pend[-1] ask(x) get_res() update(x) else: assert input() == "WAIT" s, a, b = get_res() if not s: assert n == 0 else: update(a) t ^= 1