Problem:
 Score: 800 points    Problem Statement  This is an interactive task.  We have 2N balls arranged in a row, numbered 1, 2, 3, ..., 2N from left to right, where N is an odd number. Among them, there are N red balls and N blue balls.  While blindfolded, you are challenged to guess the color of every ball correctly, by asking at most 210 questions of the following form:   You choose any N of the 2N balls and ask whether there are more red balls than blue balls or not among those N balls.   Now, let us begin.      Constraints   1 \leq N \leq 99  N is an odd number.        Input and Output  First, receive the number of balls of each color, N , from Standard Input:  N   Then, ask questions until you find out the color of every ball.
A question should be printed to Standard Output in the following format:  ? A_1  A_2  A_3  ...  A_N   This means that you are asking about the N balls A_1, A_2, A_3, ..., A_N , where 1 \leq A_i \leq 2N and A_i \neq A_j (i \neq j) must hold.  The response T to this question will be given from Standard Input in the following format:  T   Here T is one of the following strings:   Red : Among the N balls chosen, there are more red balls than blue balls.  Blue : Among the N balls chosen, there are more blue balls than red balls.  -1 : You printed an invalid question (including the case you asked more than 210 questions), or something else that was invalid.   If the judge returns -1 , your submission is already judged as incorrect. The program should immediately quit in this case.  When you find out the color of every ball, print your guess to Standard Output in the following format:  ! c_1 c_2 c_3 ... c_{2N}   Here c_i should be the character representing the color of Ball i ; use R for red and B for blue.      Notice   Flush Standard Output each time you print something. Failure to do so may result in TLE .  Immediately terminate your program after printing your guess (or receiving the -1 response). Otherwise, the verdict will be indeterminate.  If your program prints something invalid, the verdict will be indeterminate.        Sample Input and Output    Input  Output    3      ? 1 2 3    Red      ? 2 4 6    Blue      ! RRBBRB    In this sample, N = 3 , and the colors of Ball 1, 2, 3, 4, 5, 6 are red, red, blue, blue, red, blue, respectively.   In the first question, there are two red balls and one blue ball among the balls 1, 2, 3 , so the judge returns Red .  In the second question, there are one red ball and two blue balls among the balls 2, 4, 6 , so the judge returns Blue .

Solution (Python):
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n = int(input())


import sys
count = 0
def query(l):
    global count
    count = count + 1
    if count>210:
        assert False
    print("? %s" % " ".join(map(str, l)))
    sys.stdout.flush()
    return input()

color = query(list(range(1,n+1)))
l = 1
r = n+1
while l<r-1:
    m = (l+r)//2

    if color==query(range(m,m+n)):
        l = m
    else:
        r = m
ans = [None]*(2*n)

ll = list(range(r, r+n-1))
for i in range(1,2*n+1):
    if r<=i<=r+n-2:
        continue
    color = query(ll + [i])
    ans[i-1] = "B" if color=="Blue" else "R"
ll2 = []
bc = 0
rc = 0
for i in range(1,2*n+1):
    if r<=i<=r+n-2:
        continue
    if ans[i-1]=="R" and rc<n//2:
        rc += 1
        ll2.append(i)
    elif ans[i-1]=="B" and bc<n//2:
        bc += 1
        ll2.append(i)
assert len(ll2)==n-1
for i in range(r,r+n-1):
    color = query(ll2 + [i])
    ans[i-1] = "B" if color=="Blue" else "R"

print("! %s" % "".join(map(str, ans)))

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce
import pprint
sys.setrecursionlimit(10 ** 9)


INF = 100
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007


n = I()
print("? " +  " ".join(map(str, [i for i in range(1, n + 1)])))
flg = str(input())
ng = n + 1
ok = 1
while ok + 1 < ng:
    mid = (ok + ng) // 2
    print("? " + " ".join(map(str, [i for i in range(mid, mid + n)])))
    if flg != str(input()):
        ng = mid
    else:
        ok = mid


L = [i for i in range(ok + 1, ok + n)]
b_cnt = 0
r_cnt = 0
LL = []
R = []
B = []
if flg == "Red":
    R += [ok]
    B += [ok + n]
else:
    B += [ok]
    R += [ok + n]

for j in range(1, 2 * n + 1):
    if ok <= j <= ok + n:
        continue
    L += [j]
    print("? " + " ".join(map(str, L)))
    L.pop()
    s = str(input())
    if s == "Blue":
        B += [j]
    else:
        R += [j]

LL = B[:n//2] + R[:n//2]
for k in range(ok + 1, ok + n):
    LL += [k]
    print("? " + " ".join(map(str, LL)))
    LL.pop()
    if str(input()) == "Blue":
        B += [k]
    else:
        R += [k]


ans = [""] * (2 * n)
for b in B:
    ans[b - 1] = "B"
for r in R:
    ans[r - 1] = "R"

print("! " + "".join(map(str, ans)))

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce
import pprint
sys.setrecursionlimit(10 ** 9)


INF = 100
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007


n = I()
print("? " +  " ".join(map(str, [i for i in range(1, n + 1)])))
flg = str(input())
ng = n + 1
ok = 1
while ok + 1 < ng:
    mid = (ok + ng) // 2
    print("? " + " ".join(map(str, [i for i in range(mid, mid + n)])))
    s = str(input())
    if flg != s:
        ng = mid
    else:
        ok = mid


L = [i for i in range(ok + 1, ok + n)]
b_cnt = 0
r_cnt = 0
LL = []
R = []
B = []
if flg == "Red":
    R += [ok]
    B += [ok + n]
else:
    B += [ok]
    R += [ok + n]

for j in range(1, 2 * n + 1):
    if ok <= j <= ok + n:
        continue
    L += [j]
    print("? " + " ".join(map(str, L)))
    L.pop()
    s = str(input())
    if s == "Blue":
        B += [j]
    else:
        R += [j]

LL = B[:n//2] + R[:n//2]
for k in range(ok + 1, ok + n):
    LL += [k]
    print("? " + " ".join(map(str, LL)))
    LL.pop()
    s = str(input())
    if s == "Blue":
        B += [k]
    else:
        R += [k]


ans = [""] * (2 * n)
for b in B:
    ans[b - 1] = "B"
for r in R:
    ans[r - 1] = "R"

print("! " + "".join(map(str, ans)))

Solution (Python):
def examA():
    N = I()
    A = LI()
    D = defaultdict(int)
    for a in A:
        D[a] += 1
    ans = 0
    for key,d in D.items():
        if key>d:
            ans += d
        else:
            ans += d - key
    print(ans)
    return

def examB():
    N = I()
    A = LI()
    S = [0]*(N+1)
    for i in range(N):
        S[i+1] = S[i]+A[i]
    D = defaultdict(int)
    for s in S:
        D[s] += 1
    ans = 0
    for d in D.values():
        ans += d*(d-1)//2
    print(ans)
    return

def examC():
    N, A, B, C = LI()
    L = [I()for _ in range(N)]
    loop = (1<<(2*N))
    ans = inf
    for l in range(loop):
        cost = 0
        bamboo_A = 0
        bamboo_B = 0
        bamboo_C = 0
        for j in range(N):
            if l&(1<<(2*j))>0:
                if l&(1<<(2*j+1))>0:
                    cost += 10
                    bamboo_A += L[j]
                else:
                    cost += 10
                    bamboo_B += L[j]
            else:
                if l&(1<<(2*j+1))>0:
                    cost += 10
                    bamboo_C += L[j]
        if bamboo_A==0 or bamboo_B==0 or bamboo_C==0:
            continue
        cost += abs(A-bamboo_A) + abs(B-bamboo_B) + abs(C-bamboo_C) - 30
        ans = min(ans,cost)

    print(ans)
    return

def examD():
    N = I()
    P = LI()
    O_ = [-1]*N
    start = P[0]-1
    for i in range(N):
        O_[P[i]-1] = i
    
    A = [1]*N
    B = [1]*N
    for i in range(start+1,N):
        cur = O_[i]-O_[i-1]
        if cur>0:
            A[i] = A[i-1] + (cur+1)
            B[i] = B[i-1] - 1
        else:
            A[i] = A[i-1] + 1
            B[i] = B[i-1] - (-cur+1)
    for i in range(start)[::-1]:
        cur = O_[i]-O_[i+1]
        if cur>0:
            B[i] = B[i+1] + (cur+1)
            A[i] = A[i+1] - 1
        else:
            B[i] = B[i+1] + 1
            A[i] = A[i+1] - (-cur+1)
    if A[0]<1:
        add = (1-A[0])
        for i in range(N):
            A[i] += add
    if B[-1]<1:
        add = (1-B[-1])
        for i in range(N):
            B[i] += add

    print(" ".join(map(str,A)))
    print(" ".join(map(str,B)))
    return

def examE():
    N = I()
    V = [[]for _ in range(N)]
    for _ in range(N-1):
        x, y = LI()
        x -= 1; y -= 1
        V[x].append(y)
        V[y].append(x)
    def dfs(s,p=-1):
        loop = 0
        grundy = 0
        children = []
        for v in V[s]:
            if v==p:
                continue
            loop += 1
            children.append(dfs(v,s)+1)
        if loop==1:
            grundy = children[0]
        elif loop>1:
            for c in children:
                grundy ^= c
        return grundy
    if dfs(0):
        print("Alice")
    else:
        print("Bob")
    return

def examF():
    N = I()
    ans = [""]*(2*N)
    print("? " + " ".join(map(str,[i+1 for i in range(N)])))
    base = str(input())
    l = 1; r = N+1
    while(r-l>1):
        now = (l+r)//2
        rep = [i+now for i in range(N)]
        print("? " + " ".join(map(str,rep)))
        res = str(input())
        if base==res:
            l = now
        else:
            r = now

    R = []; B = []
    if base=="Red":
        ans[l-1] = "R"
        ans[l+N-1] = "B"
        R.append(l-1); B.append(l+N-1)
    else:
        ans[l-1] = "B"
        ans[l+N-1] = "R"
        B.append(l-1); R.append(l+N-1)

    

    for i in range(2*N):
        if l<=i+1<=l+N:
            continue
        rep = [k+l+1 for k in range(N-1)]
        rep.append(i+1)
        print("? " + " ".join(map(str,rep)))
        res = str(input())
        if res=="Red":
            ans[i] = "R"
            R.append(i)
        elif  res=="Blue":
            ans[i] = "B"
            B.append(i)
        else:
            print(hoge)

    check = []
    for i in range(N//2):
        check.append(R[i]+1)
        check.append(B[i]+1)

    
    

    for i in range(2*N):
        if ans[i]!="":
            continue
        rep = check + [i+1]
        print("? " + " ".join(map(str,rep)))
        res = str(input())
        if res=="Red":
            ans[i] = "R"
        elif res=="Blue":
            ans[i] = "B"
        else:
            print(hoge)

    print("! "+"".join(map(str,ans)))
    return


from decimal import getcontext,Decimal as dec
import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def I(): return int(input())
def LI(): return list(map(int,sys.stdin.readline().split()))
def DI(): return dec(input())
def LDI(): return list(map(dec,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = dec("0.000000000001")
alphabet = [chr(ord('a') + i) for i in range(26)]
alphabet_convert = {chr(ord('a') + i): i for i in range(26)}

getcontext().prec = 28

sys.setrecursionlimit(10**7)

if __name__ == '__main__':
    examF()

"""
9
7 3 9 1 8 4 5 6 2

3
Red
Blue
Red
Blue
Red
Blue
"""

Solution (Python):
n = int(input())
f = ['']*(n+2)


def question(a):
    print('?', *a)
    response = input()
    if response == "-1":
        exit()
    return response


def chk(x):
    a = [x+j for j in range(n)]
    if f[x] == '':
        f[x] = question(a)
    return f[x]


bottom = 1
top = n+1
f[bottom] = chk(bottom)
f[top] = chk(top)

while top - bottom > 1:
    middle = (top + bottom)//2
    if chk(middle) == f[top]:
        top = middle
    else:
        bottom = middle

a = [bottom+j for j in range(1, n)]
b = []
for x in range(1, 2*n+1):
    if x not in a and x != bottom and x != bottom+n:
        b.append(x)

ans = []
for x in range(1, 2*n+1):
    if x in a:
        c = b+[x]
    else:
        c = a+[x]
    ans.append(question(c)[0])

print('!', ''.join(ans))

Solution (Python):
import sys
readline = sys.stdin.readline

import itertools


DEBUG = False

N = int(readline())

class Interactive:
    def __init__(self):
        self.ques_cnt = 0
        self.create_data()
        
    def create_data(self):
        import random
        A = ['B']*N + ['R']*N
        random.shuffle(A)
        self.A = [None] + A
        
    def resp_ques(self, *args):
        self.ques_cnt += 1
        assert len(args) == N
        from collections import Counter
        A = self.A
        selected = [A[i] for i in args]
        counter = Counter(selected)
        resp = 'Red' if counter['R'] > counter['B'] else 'Blue'
        return resp
    
    def resp_ans(self, *args):
        if len(args) != 1 or not isinstance(args[0], str):
            raise ValueError('Answer must be a string')
        if list(args[0]) == self.A[1:]:
            print('AC!')
            print('num of questions:', self.ques_cnt)
        else:
            print('WA!')
            
if DEBUG:
    interactive = Interactive()
    
def question(*args):
    print('?', *args, flush=True)
    if DEBUG:
        resp = interactive.resp_ques(*args)
        print(resp)
        return resp
    else:
        return readline()
    
def answer(*args):
    print('!', *args, flush=True)
    if DEBUG:
        interactive.resp_ans(*args)
    else:
        exit()

def make_LR_range(L,R):
    return itertools.chain(range(1,L+1), range(N+N-R+1, N+N+1))

def f(L):
    return question(*make_LR_range(L, N-L)).rstrip()


L = 0
R = N
cL = f(L)
while L + 1 < R:
    x = (L + R) // 2
    if cL == f(x):
        L = x
    else:
        R = x

inv = {'B':'R', 'R':'B'}

C = [None] * (N+N+1)
C[L+1] = inv[cL[0]]
C[L+N+1] = cL[0]

A = list(range(1,L+1)) + list(range(L+N+2,N+N+1))
B = list(range(L+2,L+N+1))
for b in B:
    resp = question(b, *A)
    C[b] = resp[0]
for a in A:
    resp = question(a, *B)
    C[a] = resp[0]

answer(''.join(C[1:]))

Solution (Python):
import sys

def query(A):
    print(*(['?'] + sorted([1+a for a in A])), flush = True)
    return True if input().strip() == 'Red' else False

N = int(input())

zans = query(list(range(N)))
ok = 0
ng = N

while abs(ok-ng) > 1:
    med = (ok+ng)//2
    if query(list(range(med, med+N))) == zans:
        ok = med
    else:
        ng = med

tool1 = list(range(ok+1, ok+N))
st1 = set(tool1)
col = [None]*(2*N)

for i in range(2*N):
    if i in tool1:
        continue
    col[i] = query([i] + tool1)

cr = 0
cb = 0
tool2 = []
for i in range(2*N):
    if col[i] is None:
        continue
    if col[i]:
        if cr < N//2:
            cr += 1
            tool2.append(i)
    else:
        if cb < N//2:
            cb += 1
            tool2.append(i)

for i in tool1:
    col[i] = query(tool2 + [i])

print(''.join(['! '] + ['R' if col[i] else 'B' for i in range(2*N)]), flush = True)

Solution (Python):

import sys
sys.setrecursionlimit(10**6)
input = sys.stdin.readline

def query(index):
    q = [item % (2*n) + 1 for item in range(index, index+n)]
    s_q = "? " + " ".join([str(item) for item in q])
    print(s_q, flush=True)
    ret = input().rstrip()
    return ret

n = int(input())
init_color = query(0)
l = 0; r = n
while r - l > 1:
    mid = (l + r) // 2
    ret = query(mid)
    if ret == init_color:
        l = mid
    else:
        r = mid

ans = [""] * (2*n)


equal_set = [item % (2 * n) for item in range(r, r+n-1)]
for i in range(r + n - 1, l + 1 + 2*n):
    index = i % (2*n)
    s_q = "? " + " ".join([str(item + 1) for item in equal_set + [index]])
    print(s_q, flush=True)
    ret = input().rstrip()
    ans[index] = ret[0]


equal_set = [item % (2 * n) for item in range(r+n, r+n+n-1)]
for i in range(r, r+n-1):
    index = i % (2*n)
    s_q = "? " + " ".join([str(item + 1) for item in equal_set + [index]])
    print(s_q, flush=True)
    ret = input().rstrip()
    ans[index] = ret[0]

print("! " + "".join([item for item in ans]), flush=True)

Solution (Python):
def judge(As):
    print('?', *[A + 1 for A in As])
    res = input()
    if res == '-1':
        exit()
    return res[0]
N = int(input())
N2 = N + N
L, R = 0, N
fL = judge(range(L, L + N))
fR = 'B' if fL == 'R' else 'R'
while R - L > 1:
    mid = (L + R) // 2
    fM = judge(range(mid, mid + N))
    if fM == fL:
        L = mid
    else:
        R = mid
res = [''] * N2
res[L] = fL
res[L + N] = fR
T1s = set(range(L + 1, L + N))
T2s = set(range(L)) | set(range(L + N + 1, N2))
for i in range(N2):
    if i == L or i == L + N:
        continue
    if i in T1s:
        res[i] = judge(T2s | {i})
    else:
        res[i] = judge(T1s | {i})
print('! ', ''.join(res))

Solution (Python):
def judge(As):
    print('?', *[A + 1 for A in As])
    res = input()
    if res == '-1':
        exit()
    return res[0]
N = int(input())
N2 = N + N
L, R = 0, N
fL = judge(range(L, L + N))
fR = 'B' if fL == 'R' else 'R'
while R - L > 1:
    mid = (L + R) // 2
    fM = judge(range(mid, mid + N))
    if fM == fL:
        L = mid
    else:
        R = mid
res = [''] * N2
res[L] = fL
res[L + N] = fR
T1s = set(range(L + 1, L + N))
T2s = set(range(L)) | set(range(L + N + 1, N2))
for i in range(N2):
    if i == L or i == L + N:
        continue
    if i in T1s:
        res[i] = judge(T2s | {i})
    else:
        res[i] = judge(T1s | {i})
print('!', ''.join(res))

Solution (Python):
numbers = list(map(int, input().split()))
n = numbers[0]

l = []
l = l + list(range(1, 2*n+1))

print("?", " ".join(map(str, l[:n])))

culoare_initiala = input()

st = 0
dr = n

while st < dr - 1:
    mij = (st + dr) // 2
    
    
    print("?", " ".join(map(str, l[mij: mij+n])))
    
    culoare = input()
    if culoare == culoare_initiala:
        st = mij
    else:
        dr = mij
        
rezultat = ["_"] * (2*n)

rezultat[st] = culoare_initiala[0]
if culoare_initiala == "Blue":
    rezultat[st+n] = "R"
else:
    rezultat[st+n] = "B"

v = []
v = v + list(range(st+1, st+n)) 
w = []
for i in range(2*n):
    if i not in v and i != st and i != st + n:
        w.append(i)
        
assert len(v) == len(w)

for i in range(2 * n):
    if rezultat[i] != "_":
        continue
    if i not in v:
        z = v
    else:
        z = w
    print("?", str(i+1), " ".join([str(i+1) for i in z]))
    rezultat[i] = input()[0]
    
print("!", "".join(rezultat))

Solution (Python):
import sys

def judge(As):
    print('?', *[A+1 for A in As])
    res = input()
    if res == '-1':
        sys.exit()
    return res[0]

N = int(input())

N2 = 2*N

L, R = 0, N
fL = judge(range(L, L+N))
fR = 'B' if fL == 'R' else 'R'
while R-L > 1:
    mid = (L+R) // 2
    fM = judge(range(mid, mid+N))
    if fM == fL:
        L = mid
    else:
        R = mid

anss = [''] * N2
anss[L] = fL
anss[L+N] = fR

T1s = set(range(L+1, L+N))
T2s = set(range(L+N+1, N2)) | set(range(L))

for i in range(N2):
    if i == L or i == L+N: continue
    if i in T1s:
        anss[i] = judge(T2s | {i})
    else:
        anss[i] = judge(T1s | {i})

print('!', ''.join(anss))

Solution (Python):
N = int(input())
ans = ['R' for i in range(N << 1)]


def ask(arr):
    query = "?"
    for e in arr:
        query += " " + str(e)
    print(query, flush=True)
    return input()


arr = [i for i in range(1, N+1)]
color = ask(arr)
another = 'Red' if (color == 'Blue') else 'Blue'
l = 1
r = N
res = -1
while l <= r:
    mid = (l+r) >> 1
    arr = [i for i in range(mid, mid+N)]
    tmp_color = ask(arr)
    if(tmp_color == color):
        res = mid
        l = mid+1
    else:
        r = mid-1

l = res - 1
r = res + N - 1

ans[l] = color
ans[r] = another

for i in range(N << 1):
    if(i == l or i == r):
        continue
    arr = []
    if i > l and i < r:
        arr += [j for j in range(1, l+1)]
        arr += [j for j in range(r+2, N*2 + 1)]
        arr.append(i+1)
        ans[i] = ask(arr)
    else:
        arr = [j for j in range(l+2, r+1)]
        arr.append(i+1)
        ans[i] = ask(arr)
res = "! "
for i in range(N << 1):
    res += ans[i][0]
print(res, flush=True)

Solution (Python):
N = int(input())
A = [''] * (2 * N)
temp = []

def take(i):
	T = input()
	if T == 'Blue':
		A[i] = 'B'
	elif T == 'Red':
		A[i] = 'R'
	else:
		exit()

L = 0
R = N
print('?'," ".join(str(k+1) for k in range(L, L + N)),flush = True)
take(L)

while R-L > 1:
	mid = int((R+L)/2)
	print('?'," ".join(str(k+1) for k in range(mid,mid + N)),flush = True)
	take(mid)
	if A[mid] == A[L]:
		L = mid
	else:
		R = mid

for i in range(0, R-1):
	print('?'," ".join(str(k+1) for k in range(L+1, L + N)),i+1,flush = True)
	take(i)
	temp += [i]

for i in range(R + N, 2 * N):
	print('?'," ".join(str(k+1) for k in range(R, R + N - 1)),i+1,flush = True)
	take(i)
	temp += [i]

for i in range(R, R + N):
	print('?'," ".join(str(k+1) for k in temp),i+1,flush = True)
	take(i)

print('!',"".join(A),flush = True)
exit()

Solution (Python):
N = int(input())

def ask1(n):
  s = ['?'] + [i for i in range(n,n+N)]
  print(*s)
  return input()

def ask2(a,l,r):
  if l == r:
    s = ['?'] + [a] 
  else:
    s = ['?'] + [a] + [i for i in range(l,r+1)]
  print(*s)
  return input()

def ask3(a,l,r):
  if l == r:
    s = ['?'] + [a] 
  elif l < 1:
    s = ['?'] + [a] + [i for i in range(N+2,N*2+1)]
  elif r > N*2:
    s = ['?'] + [a] + [i for i in range(1,N)]
  else:
    s = ['?'] + [a] + [i for i in range(1,l+1)] + [i for i in range(r,N*2+1)]
  print(*s)
  return input()






ans = ['' for _ in range(N*2)]

a = ask1(1)
if a == 'Red':
  LC = 'Red'
else:
  LC = 'Blue'

l = 1
r = N+1
while(l+1 < r):
  m = (l+r)//2
  a = ask1(m)
  if a == LC:
    l = m
  else:
    r = m

sl = r
sr = l+N-1
for i in range(1,N*2+1):
  if sl <= i <= sr:
    a = ask3(i,sl-2,sr+2)
  else:
    a = ask2(i,sl,sr)
  if a == 'Red':
    ans[i-1] = 'R'
  else:
    ans[i-1] = 'B'
  
print('! '+''.join(ans))

Solution (Python):
n = int(input())

l = 1
r = n + 1


def ask(k):
    print(*k)
    x = input()
    return x[0]


al = ask(['?'] + [str(i) for i in range(1, n + 1)])

while r - l > 1:
    m = (l + r) // 2
    am = ask(['?'] + [str(i) for i in range(m, m + n)])
    if am == al:
        l = m
    else:
        r = m

ans = [0] * (2 * n + 1)
ans[l] = al
ans[r + n - 1] = 'R' if al == 'B' else 'B'
t = ['?'] + [str(i) for i in range(r, r + n - 1)]
tt = ['?'] + [str(i) for i in range(1, l)] + [str(i) for i in range(r + n, 2 * n + 1)]

for i in range(1, 2 * n + 1):
    if ans[i] == 0:
        if i < r or i >= r + n:
            ans[i] = ask(t + [str(i)])
        else:
            ans[i] = ask(tt + [str(i)])

s = ''.join(ans[1:])
print('! '+s)

Solution (Python):
N=int(input())

print("?",*list(range(1,N+1)),flush=True)

RB={"Red":0, "Blue":1}

Left=RB[input()]
Right=1-Left

OK=1
NG=N+1

ANS=[-1]*(2*N+1)

while NG-OK>1:
    mid=(OK+NG)//2

    print("?",*list(range(mid,N+mid)),flush=True)

    MC=RB[input()]

    if Left==MC:
        OK=mid
    else:
        NG=mid

ANS[OK]=Left
ANS[OK+N]=Right

SAME1=list(range(OK+1,OK+N))

SAME2=[]
for i in range(N-1):
    SAME2.append((OK+N+i)%(2*N)+1)

SAMESET1=set(SAME1)
SAMESET2=set(SAME2)

for i in range(1,2*N+1):
    if ANS[i]!=-1:
        continue
    if i in SAMESET1:
        print("?",*[i]+SAME2,flush=True)

        ANS[i]=RB[input()]

    else:
        print("?",*[i]+SAME1,flush=True)

        ANS[i]=RB[input()]

ANS="".join(map(str,ANS[1:]))
print("!",ANS.replace("1","B").replace("0","R"),flush=True)

Solution (Python):
n=int(input())
def b_search(a,b,value):
    med=(a+b)//2
    if a==b:return a
    else:
        if a+1==b:
            out("?",[i+1 for i in range(b,b+n)])
            v=input()
            if value(v):return b
            else:return a
        else:
            out("?",[i+1 for i in range(med,med+n)])
            v=input()
            if value(v):
                return b_search(med,b,value)
            else:
                return b_search(a,med-1,value)

def out(a,l):
    ll=[a]+l
    print(*ll)

out("?",[i+1 for i in range(n)])
v=input()
value=lambda x:x==v
k=b_search(0,n,value)

ans=[0]*(2*n)
l1=[i+1 for i in range(k+1,k+n)]
for i in range(k+1):
    out("?",l1+[i+1])
    v=input()
    if v=="Red":
        ans[i]="R"
    else:
        ans[i]="B"
for i in range(k+n,2*n):
    out("?",l1+[i+1])
    v=input()
    if v=="Red":
        ans[i]="R"
    else:
        ans[i]="B"
l2=[i+1 for i in range(k)]+[i+1 for i in range(k+n+1,2*n)]
for i in range(k+1,k+n):
    out("?",l2+[i+1])
    v=input()
    if v=="Red":
        ans[i]="R"
    else:
        ans[i]="B"
print("! "+"".join(ans),flush=True)

Solution (Python):
from sys import exit
def q(l):
    print("?",end=" ")
    for i in l:
        print(i,end=" ")
    print("")
    ret=input()
    if ret=="-1":
        exit(0)
    return ret=="Red"

n=int(input())
res=[None for i in range(n*2+1)]
if n==1:
    if q([1]):
        res=[None,"R","B"]
    else:
        res=[None,"B","R"]
else:
    a=[i for i in range(1,(n+1)//2)]
    b=[i for i in range((n+1)//2,n+1)]
    c=[i for i in range(n+1,(n+1)//2+n+1)]
    d=[i for i in range((n+1)//2+n+1,n*2+1)]
    ab=q(a+b)
    ac=q(a+c)
    if ab and ac:
        
        toadd=b
        rr=a
        bb=d
    elif ab and not ac:
        
        toadd=a
        rr=b
        bb=c
    elif not ab and ac:
        
        toadd=a
        rr=c
        bb=b
    elif not ab and not ac:
        
        toadd=c
        rr=d
        bb=a
    else:
        pass
    blim=0
    rlim=len(rr)
    while rlim-blim>1:
        en=(blim+rlim)//2
        if q(toadd+rr[:en]+bb[en:]):
            rlim=en
        else:
            blim=en
    arr=toadd+rr[:blim]+bb[blim+1:]
    for i in range(1,2*n+1):
        if i in arr:
            continue
        if q(arr+[i]):
            res[i]="R"
        else:
            res[i]="B"
    half=[]
    rcnt=0
    bcnt=0
    for i in range(1,2*n+1):
        if res[i]=="R":
            if rcnt<(n-1)//2:
                half.append(i)
                rcnt+=1
        elif res[i]=="B":
            if bcnt<(n-1)//2:
                half.append(i)
                bcnt+=1
    for i in range(1,2*n+1):
        if res[i]==None:
            ret=q(half+[i])
            if ret:
                res[i]="R"
            else:
                res[i]="B"
print("!",end=" ")
for c in res[1:]:
    print(c,end="")
print("",flush=True)

Solution (Python):
N = int(input())

def query(s):
    q = ['?']
    for c in s:
        q.append(c+1)
    print(*q)
    res = input()
    if res=='-1':
        exit()
    return res[0]

color = query(list(range(N)))
ok = 0
ng = N
while ng-ok > 1:
    m = (ok+ng)//2
    if query(list(range(m,N+m))) == color:
        ok = m
    else:
        ng = m

ans = ['_'] * (2*N)
st = set(range(ok+1,ok+N))
for i in range(N*2):
    if i in st: continue
    st.add(i)
    res = query(st)
    ans[i] = res
    st.remove(i)

st = set()
b = r = 0
for i,c in enumerate(ans):
    if c=='B' and b<N//2:
        b += 1
        st.add(i)
    elif c=='R' and r<N//2:
        r += 1
        st.add(i)
for i in range(N*2):
    if ans[i] != '_': continue
    st.add(i)
    res = query(st)
    ans[i] = res
    st.remove(i)

print('! ' + ''.join(ans))

Solution (Python):
import sys

def line(n, N):
    return list(range(2*N)[n:n+N])

def convert(T):
    if T == "Red":
        return "R"
    elif T == "Blue":
        return "B"
    else:
        sys.exit()
    
def ask(question):
    print("?", end=" ")
    [print(x+1, end=" ") for x in question]
    print(flush=True)

def run(X):
    question = line(X, N)
    ask(question)
    T = input()
    visited[X] = convert(T)


N = int(input())
visited = ["*"]*2*N
Aestimated = ["*"]*2*N
L = 0
R = N
run(L)
run(R)
while True:
    M = int((L+R)/2)
    run(M)
    if visited[L] == visited[M]:
        L = M
    elif visited[R] == visited[M]:
        R = M
    if R-L == 1:
        break

Aestimated[L] = visited[L]
Aestimated[R+N-1] = visited[R]

S2 = list(range(R,R+N-1))
S1 = list(set(range(2*N)) - set(S2) - {L} - {R+N-1}) 
for s1 in S1:
    S = S2 + [s1]
    ask(S)
    T = input()
    Aestimated[s1] = convert(T)

for s2 in S2:
    S = S1 + [s2]
    ask(S)
    T = input()
    Aestimated[s2] = convert(T)

print("!", "".join(Aestimated), flush=True)

Solution (Python):
import sys

input = sys.stdin.readline

N = int(input())

print('?', *range(1,N+1))
sys.stdout.flush()
reply = input().strip()
nrb = ['.']*(N+1)
nrb[0] = reply
if reply=='Red':
	LC, RC = 'Red', 'Blue'
elif reply=='Blue':
	LC, RC = 'Blue', 'Red'
else:
	sys.exit()

Lind, Rind = 0, N
while Rind-Lind>1:
	mind = (Lind+Rind)//2
	print('?', *range(mind+1,mind+N+1))
	sys.stdout.flush()
	reply = input().strip()
	if reply==LC:
		Lind = mind
	elif reply==RC:
		Rind = mind
	else:
		sys.exit()

rb = ['.']*(2*N)
rb[Lind], rb[Rind+N-1] = LC, RC
inlist, outlist = [], []
for i in range(2*N):
	if Lind<i<Rind+N-1:
		rb[i] = 'in'
		inlist.append(i+1)
	elif i<Lind or Rind+N-1<i:
		rb[i] = 'out'
		outlist.append(i+1)

for i in range(2*N):
	if rb[i]=='in':
		print('?', i+1, *outlist)
		sys.stdout.flush()
		reply = input().strip()
		if reply=='-1': sys.exit()
		rb[i] = reply
	elif rb[i]=='out':
		print('?', i+1, *inlist)
		sys.stdout.flush()
		reply = input().strip()
		if reply=='-1': sys.exit()
		rb[i] = reply

for i in range(2*N):
	if rb[i]=='Red':
		rb[i] = 'R'
	else:
		rb[i] = 'B'

print('! ', *rb, sep='')