#include <bits/stdc++.h>   using namespace std;   int n;   vector<int> qucv[3], v;   void quc() {     cout <<  ? OC n ;     cout.flush();     int k;     cin >> k;     if (k == -1) exit(0);     while (k--) {       int x;       cin >> x;       qucv[0].push_back(x);     }     cout <<  ? HC n ;     cout.flush();     cin >> k;     if (k == -1) exit(0);     while (k--) {       int x;       cin >> x;       qucv[1].push_back(x);     }     cout <<  ? CC n ;     cout.flush();     cin >> k;     if (k == -1) exit(0);     while (k--) {       int x;       cin >> x;       qucv[2].push_back(x);     }   }   void qu(string s) {     cout <<  ?   << s << endl;     cout.flush();     int k;     cin >> k;     if (k == -1) exit(0);     v.clear();     while (k--) {       int x;       cin >> x;       v.push_back(x);     }   }   int eq(string s, string ans) {     string fans(4,  ? );     vector<string> vv({ CO ,  CH ,  CC ,  OH ,  HHH ,  OOO });     for (int i = 0; i < vv.size(); i++) {       string now = vv[i];       for (int j = 0; j < s.size() - now.size() + 1; j++) {         int r = 1;         for (int l = 0; l < now.size(); l++) {           if (s[j + l] != now[l]) {             r = 0;             break;           }         }         if (r) {           for (int l = 0; l < now.size(); l++) {             fans[j + l] = now[l];           }         }       }     }     for (int i = 0; i < 4; i++) {       if (ans[i] != fans[i]) {         return 0;       }     }     return 1;   }   string pp(string s) {     for (int i = s.size() - 1; i >= 0; i--) {       if (s[i] ==  C ) {         s[i] =  H ;         return s;       }       if (s[i] ==  H ) {         s[i] =  O ;         return s;       }       s[i] =  C ;     }     return s;   }   void solve4() {     int n = 4;     string ans(n,  ? );     qu( CC );     for (int i = 0; i < v.size(); i++) {       ans[v[i] - 1] =  C ;       ans[v[i]] =  C ;     }     qu( CH );     for (int i = 0; i < v.size(); i++) {       ans[v[i] - 1] =  C ;       ans[v[i]] =  H ;     }     qu( CO );     for (int i = 0; i < v.size(); i++) {       ans[v[i] - 1] =  C ;       ans[v[i]] =  O ;     }     qu( OH );     for (int i = 0; i < v.size(); i++) {       ans[v[i] - 1] =  O ;       ans[v[i]] =  H ;     }     if (((ans[0] ==  ?  || ans[0] ==  O ) && (ans[1] ==  ?  || ans[1] ==  O ) &&          (ans[2] ==  ?  || ans[2] ==  O )) ||         ((ans[1] ==  ?  || ans[1] ==  O ) && (ans[2] ==  ?  || ans[2] ==  O ) &&          (ans[3] ==  ?  || ans[3] ==  O ))) {       qu( OOO );       for (int i = 0; i < v.size(); i++) {         ans[v[i] - 1] = ans[v[i] + 1] = ans[v[i]] =  O ;       }     }     if (((ans[0] ==  ?  || ans[0] ==  H ) && (ans[1] ==  ?  || ans[1] ==  H ) &&          (ans[2] ==  ?  || ans[2] ==  H )) ||         ((ans[1] ==  ?  || ans[1] ==  H ) && (ans[2] ==  ?  || ans[2] ==  H ) &&          (ans[3] ==  ?  || ans[3] ==  H ))) {       qu( HHH );       for (int i = 0; i < v.size(); i++) {         ans[v[i] - 1] = ans[v[i] + 1] = ans[v[i]] =  H ;       }     }     int cnt = 0;     for (int i = 0; i < 4; i++) {       if (ans[i] ==  ? ) cnt++;     }     if (!cnt) {       cout <<  !   << ans << endl;       cout.flush();       int r;       cin >> r;       if (r == 0) exit(0);       return;     }     string now =  CCCC ;     int sw = 0;     if (eq( OOOO , ans)) sw = 1;     string ff = ans;     int q = 0;     while (now !=  OOOO ) {       if (eq(now, ans)) {         if (q == 0 && sw == 0) {           ff = now;           now = pp(now);           q = 1;           continue;         }         qu(now);         if (v.size()) {           cout <<  !   << now << endl;           cout.flush();           int r;           cin >> r;           if (r == 0) exit(0);           return;         }       }       now = pp(now);     }     if (!sw) {       cout <<  !   << ff << endl;       cout.flush();       int r;       cin >> r;       if (r == 0) exit(0);       return;     }     cout <<  !   << now << endl;     cout.flush();     int r;     cin >> r;     if (r == 0) exit(0);   }   int main() {     int t;     cin >> t;     while (t--) {       cin >> n;       if (n == 4) {         solve4();         continue;       }       string ans(n,  ? );       qucv[0].clear();       qucv[1].clear();       qucv[2].clear();       quc();       for (int i = 0; i < qucv[0].size(); i++) {         ans[qucv[0][i] - 1] =  O ;         ans[qucv[0][i]] =  C ;       }       for (int i = 0; i < qucv[1].size(); i++) {         ans[qucv[1][i] - 1] =  H ;         ans[qucv[1][i]] =  C ;       }       for (int i = 0; i < qucv[2].size(); i++) {         ans[qucv[2][i] - 1] =  C ;         ans[qucv[2][i]] =  C ;       }       qu( OH );       for (int i = 0; i < v.size(); i++) {         ans[v[i] - 1] =  O ;         ans[v[i]] =  H ;       }       qu( HO );       for (int i = 0; i < v.size(); i++) {         ans[v[i] - 1] =  H ;         ans[v[i]] =  O ;       }       int x = 0;       char last =  ? ;       for (int i = n - 1; i > 0; i--) {         if (ans[i] !=  ? ) {           if (last ==  ? ) x = i;           last = ans[i];         }         if (ans[i] ==  ? ) {           ans[i] = last;         }       }       last =  ? ;       for (int i = 1; i < n; i++) {         if (ans[i] !=  ? ) {           last = ans[i];         }         if (ans[i] ==  ?  && x > i) {           ans[i] = last;         }       }       int y = 100;       for (int i = 0; i < n; i++) {         if (ans[i] !=  ? ) {           y = i;           break;         }       }       vector<string> chk;       int sw = 1;       if (x == 0) {         string s = ans;         for (int i = 0; i < n; i++) s[i] =  O ;         chk.push_back(s);         s[0] =  C ;         chk.push_back(s);         for (int i = 1; i < n; i++) s[i] =  H ;         chk.push_back(s);         s[0] =  H ;         chk.push_back(s);         sw = 0;       }       if (sw && ans[0] ==  ?  && ans[n - 1] ==  ? ) {         string s = ans;         s[0] = s[y];         for (int i = n - 1; i > x; i--) {           s[i] =  O ;         }         chk.push_back(s);         s[0] =  C ;         chk.push_back(s);         for (int i = n - 1; i > x; i--) {           s[i] =  H ;         }         chk.push_back(s);         s[0] = s[y];         chk.push_back(s);         sw = 0;       }       if (sw && ans[0] ==  ? ) {         string s = ans;         s[0] =  C ;         chk.push_back(s);         s[0] = s[1];         chk.push_back(s);         sw = 0;       }       if (sw && ans[n - 1] ==  ? ) {         string s = ans;         for (int i = n - 1; i > x; i--) {           s[i] =  H ;         }         chk.push_back(s);         for (int i = n - 1; i > x; i--) {           s[i] =  O ;         }         chk.push_back(s);         sw = 0;       }       if (sw || chk.size() == 0) {         cout <<  !   << ans << endl;         cout.flush();         int r;         cin >> r;         if (r == 0) exit(0);         continue;       }       int r = -1;       for (int i = 0; i < chk.size() - 1; i++) {         qu(chk[i]);         if (v.size()) {           cout <<  !   << chk[i] << endl;           cout.flush();           cin >> r;           if (r == 0) {             exit(0);           }           break;         }       }       if (r == -1) {         cout <<  !   << chk.back() << endl;         cout.flush();         cin >> r;         if (r == 0) {           exit(0);         }       }     }   }