Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <unordered_map>

using namespace std;
using ll = long long;

void _cin(){} template <class Head, class... Tail> void _cin(Head&& head, Tail&&... tail){ cin >> head; _cin(forward<Tail>(tail)...); }
void _cout(){ cout << endl; } template <class Head, class... Tail> void _cout(Head&& head, Tail&&... tail){ cout << head; _cout(forward<Tail>(tail)...); }
int gcd(int a, int b){ return (b == 0) ? a : gcd(b, a % b); }
template<typename S, typename T> ostream& operator<<(ostream &os, const pair<S, T> &p){ cout << "[" << p.first << ", " << p.second << "]"; return os; }

#define Sq(x) (x)*(x)
#define For(i, n) for(int i = 0; i < (n); i ++)
#define Rep(n) For(_, n)
#define Range(c) c.begin(), c.end()
#define RevRange(c) c.rbegin(), c.rend()
#define Contains(c, x) (find(Range(c), x) != c.end())
#define Search(rb, re, x) distance(rb, find(rb, re, x))
#define Sort(a) sort(Range(a))
#define DeSort(a) sort(RevRange(a))
#define Reverse(c) reverse(Range(c))
#define Unique(a) a.erase(unique(Range(a)), a.end())
#define Cusum(T, xs, sxs) vector<T> sxs(xs.size()+1); For(i, (int)xs.size()) sxs[i+1] = sxs[i] + xs[i]
#define Cin(T, ...) T __VA_ARGS__; _cin(__VA_ARGS__)
#define Cins(T, n, xs) vector<T> xs(n); For(i, n) cin >> xs[i]
#define Cins2(T, n, xs, ys) vector<T> xs(n), ys(n); For(i, n) cin >> xs[i] >> ys[i]
#define Cins3(T, n, xs, ys, zs) vector<T> xs(n), ys(n), zs(n); For(i, n) cin >> xs[i] >> ys[i] >> zs[i]
#define Cinss(T, n, m, xs) Vec2(T, n, m, xs); For(i, n) For(j, m) cin >> xs[i][j]
#define Cinm(T, n, map) unordered_map<T, int> map; Rep(n){ Cin(T, x); map[x] ++; }
#define Cout(...) _cout(__VA_ARGS__)
#define Couts(xs) { for(const auto &e : xs) cout << e << " "; cout << endl; }
#define Coutyn(cond) Cout((cond) ? "yes" : "no")
#define CoutYn(cond) Cout((cond) ? "Yes" : "No")
#define CoutYN(cond) Cout((cond) ? "YES" : "NO")
#define vc vector
#define Mini(a, x) a = min(a, x)
#define Maxi(a, x) a = max(a, x)

// constexpr int MOD = 1e9+7;
// endl にした
#include <random>

int main(void){
    Cin(int, n);
    if(n == 1){
        Cout("? 1");
        Cin(string, t);
        if(t == "Red"){
            Cout("! RB");
        }
        else{
            Cout("! BR");
        }
        return 0;
    }
    
    vc<int> a(2*n);
    For(i, 2*n) a[i] = i+1;
    
    random_device seed_gen;
    mt19937 engine(seed_gen());
    
    bool f = false;
    while(!f){
        shuffle(Range(a), engine);
        For(i, n) cout << a[i] << " "; cout << endl;
        Cin(string, t1);
        For(i, n-1) cout << a[i] << " ";
        cout << a[n] << endl;
        Cin(string, t2);
        if(t1 == "-1" || t2 == "-1") return 0;
        if(t1 != t2) f = true;
    }
    
    vc<char> ans(2*n);
    int ir = -1, ib = -1;
    for(int i = n; i < 2*n; i ++){
        For(j, n-1) cout << a[j] << " ";
        cout << a[i] << endl;
        Cin(string, t);
        ans[a[i]-1] = t[0];
        if(ir == -1 && t[0] == 'R') ir = a[i]-1;
        if(ib == -1 && t[0] == 'B') ib = a[i]-1;
    }
    For(i, n){
        for(int j = n; j < 2*n; j ++){
            if(j != ir && j != ib) cout << a[j] << " ";
            cout << a[i] << " ";
            Cin(string, t);
            ans[a[j]-1] = t[0];
        }
    }
    
    cout << "! ";
    For(i, 2*n) cout << ans[i];
    coot << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:101:5: error: 'coot' was not declared in this scope
  101 |     coot << endl;
      |     ^~~~