Buggy python submission (verdict: Time Limit Exceeded):

from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

N = inp()


def kiku(a):
    print("?",' '.join(map(str,list(range(a,a+N)))))


kiku(1)

T = input()
if T == '-1':
    sys.exit(-1)

baseT = T

L = 1
R = N+1
bmid = INF
while True:
    mid = (L + R)//2
    kiku(mid)
    T = input()
    if T == "-1":
        while True:
            pass
    if T == baseT:
        L = mid
    else:
        R = mid
    if abs(bmid-mid) == 1 and bT != T:
        break
    else:
        bmid = mid
        bT = T

X = max(bmid,mid)

def kikuX(i,X):
    print("?",' '.join(map(str,list(range(X,X+N-1)))),str(i))

ans = [0]*(2*N)

Reds = []
Blues = []

for i in range(1,X):
    kikuX(i,X)
    T = input()[0]
    if T == "R":
        Reds.append(i)
    else:
        Blues.append(i)
    ans[i-1] = T

for i in range(X+N-1,N*2+1):
    kikuX(i,X)
    T = input()[0]
    if T == "R":
        Reds.append(i)
    else:
        Blues.append(i)
    ans[i-1] = T




for i in range(X,X+N-1):
    k = Reds[:N//2] + Blues[:N//2] + [i]
    print("?", ' '.join(map(str,k)))
    ans[i-1] = input()[0]

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


Fixed submission:

from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

N = inp()


def kiku(a):
    print("?",' '.join(map(str,list(range(a,a+N)))))


kiku(1)

T = input()
if T == '-1':
    sys.exit(-1)

baseT = T

setL = {1}
setR = {N+1}
bmid = INF
bbmid = INF
while True:
    L = max(setL)
    R = min(setR)

    if abs(R-L) == 1:
        break

    mid = (L + R)//2
    kiku(mid)
    T = input()
    if T == baseT:
        setL.add(mid)
    else:
        setR.add(mid)

X = R

def kikuX(i,X):
    print("?",' '.join(map(str,list(range(X,X+N-1)))),str(i))

ans = [0]*(2*N)

Reds = []
Blues = []

for i in range(1,X):
    kikuX(i,X)
    T = input()[0]
    if T == "R":
        Reds.append(i)
    else:
        Blues.append(i)
    ans[i-1] = T

for i in range(X+N-1,N*2+1):
    kikuX(i,X)
    T = input()[0]
    if T == "R":
        Reds.append(i)
    else:
        Blues.append(i)
    ans[i-1] = T




for i in range(X,X+N-1):
    k = Reds[:N//2] + Blues[:N//2] + [i]
    print("?", ' '.join(map(str,k)))
    ans[i-1] = input()[0]

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

Buggy python submission (verdict: Runtime Error):

from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

N = inp()


def kiku(a):
    print("?",' '.join(map(str,list(range(a,a+N)))))


kiku(1)

T = input()
if T == '-1':
    sys.exit(-1)

baseT = T

L = 1
R = N+1
bmid = INF
while True:
    mid = (L + R)//2
    kiku(mid)
    T = input()
    if T == baseT:
        L = mid
    else:
        R = mid
    if abs(bmid-mid) == 1 and bT != T:
        break
    else:
        bmid = mid
        bT = T

X = max(bmid,mid)

def kikuX(i,X):
    print("?",' '.join(map(str,list(range(X,X+N-1)))),str(i))

ans = [0]*(2*N)

Reds = []
Blues = []

for i in range(1,X):
    kikuX(i,X)
    T = input()[0]
    if T == "R":
        Reds.append(i)
    else:
        Blues.append(i)
    ans[i-1] = T

for i in range(X+N-1,N*2+1):
    kikuX(i,X)
    T = input()[0]
    if T == "R":
        Reds.append(i)
    else:
        Blues.append(i)
    ans[i-1] = T




for i in range(X,X+N-1):
    k = Reds[:N//2-1] + Blues[:N//2-1] + [i]
    print("?", ' '.join(map(str,k)))
    ans[i] = input()[0]

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


Fixed submission:

from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

N = inp()


def kiku(a):
    print("?",' '.join(map(str,list(range(a,a+N)))))


kiku(1)

T = input()
if T == '-1':
    sys.exit(-1)

baseT = T

setL = {1}
setR = {N+1}
bmid = INF
bbmid = INF
while True:
    L = max(setL)
    R = min(setR)

    if abs(R-L) == 1:
        break

    mid = (L + R)//2
    kiku(mid)
    T = input()
    if T == baseT:
        setL.add(mid)
    else:
        setR.add(mid)

X = R

def kikuX(i,X):
    print("?",' '.join(map(str,list(range(X,X+N-1)))),str(i))

ans = [0]*(2*N)

Reds = []
Blues = []

for i in range(1,X):
    kikuX(i,X)
    T = input()[0]
    if T == "R":
        Reds.append(i)
    else:
        Blues.append(i)
    ans[i-1] = T

for i in range(X+N-1,N*2+1):
    kikuX(i,X)
    T = input()[0]
    if T == "R":
        Reds.append(i)
    else:
        Blues.append(i)
    ans[i-1] = T




for i in range(X,X+N-1):
    k = Reds[:N//2] + Blues[:N//2] + [i]
    print("?", ' '.join(map(str,k)))
    ans[i-1] = input()[0]

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