Buggy python submission (verdict: Time Limit Exceeded):
import sys
readline = sys.stdin.readline

DEBUG = False
table = [1, 1, 0, 0, 1, 0, 1, 0, 1, 0]
def query(A):
    if DEBUG:
        return True if sum(table[a] for a in A) > N//2 else False
    print('?', *[1+a for a in A])
    return True if readline().strip() == 'Red' else False

if DEBUG:
    N = len(table)//2
else:   
    N = int(readline())

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)]))



Fixed submission:
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)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
readline = sys.stdin.readline

DEBUG = False
table = [1, 1, 0, 0, 1, 0, 1, 0, 1, 0]
def query(A):
    if DEBUG:
        return True if sum(table[a] for a in A) > N//2 else False
    print('?', *[1+a for a in A])
    return True if readline().strip() == 'Red' else False

if DEBUG:
    N = len(table)//2
else:   
    N = int(readline())

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)]))



Fixed submission:
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)