#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void chkmin(T &a, T b) {
  if (a > b) a = b;
}
template <class T>
inline void chkmax(T &a, T b) {
  if (a < b) a = b;
}
inline int read() {
  int x;
  cin >> x;
  return x;
}
const int maxn = 52;
int n;
const char mp[3] = {'C', 'H', 'O'};
int a[maxn];
int b[5][2] = {{0, 0}, {0, 1}, {0, 2}, {1, 2}, {2, 2}};
inline vector<int> ask(int *a) {
  printf("? ");
  for (int i = (1), _end_ = (n); i <= _end_; i++) printf("%c", mp[a[i]]);
  cout << endl;
  vector<int> x;
  int k = read();
  while (k--) x.push_back(read());
  return x;
}
inline void doing() {
  cin >> n;
  memset(a, -1, sizeof(a));
  if (n >= 5) {
    for (int i = (0), _end_ = (4); i <= _end_; i++) {
      cout << "? ";
      for (int j = (0), _end_ = (1); j <= _end_; j++) cout << mp[b[i][j]];
      cout << endl;
      int k = read();
      while (k--) {
        int x = read();
        a[x] = b[i][0];
        a[x + 1] = b[i][1];
      }
    }
    int flg = 0;
    for (int i = (1), _end_ = (n); i <= _end_; i++)
      if (a[i] == -1)
        ;
      else
        flg = 1;
    if (flg == 0) {
      for (int i = (2), _end_ = (n - 1); i <= _end_; i++) a[i] = 1;
    }
    int Fi = 0;
    for (int i = (1), _end_ = (n); i <= _end_; i++)
      if (~a[i]) {
        Fi = i;
        break;
      }
    for (int j = (Fi + 1), _end_ = (n - 1); j <= _end_; j++) {
      if (~a[j]) continue;
      int lst = a[j - 1];
      assert(lst != 0);
      if (lst == 1) {
        a[j] = 1;
      } else {
        a[j] = 1;
      }
    }
    Fi = 0;
    for (int i = (n), _end_ = (1); i >= _end_; i--)
      if (~a[i]) {
        Fi = i;
        break;
      }
    for (int j = (Fi - 1), _end_ = (2); j >= _end_; j--) {
      if (~a[j]) continue;
      int lst = a[j + 1];
      assert(lst != 2);
      if (lst == 1) {
        a[j] = 1;
      } else {
        a[j] = 1;
      }
    }
    for (int S = (0), _end_ = (2); S <= _end_; S++) {
      static int b[maxn];
      for (int i = (1), _end_ = (n); i <= _end_; i++) b[i] = a[i];
      if (a[1] == -1)
        b[1] = (S & 1) + 1;
      else
        b[1] = a[1];
      if (a[n] == -1)
        b[n] = (S >> 1 & 1);
      else
        b[n] = a[n];
      vector<int> t = ask(b);
      if (((int)t.size()) >= 1) {
        a[1] = b[1];
        a[n] = b[n];
        break;
      }
    }
    if (a[1] == -1) a[1] = 1 + 1;
    if (a[n] == -1) a[n] = 1;
  } else {
    for (int i = (0), _end_ = (3); i <= _end_; i++) {
      cout << "? ";
      for (int j = (0), _end_ = (1); j <= _end_; j++) cout << mp[b[i][j]];
      cout << endl;
      int k = read();
      while (k--) {
        int x = read();
        a[x] = b[i][0];
        a[x + 1] = b[i][1];
      }
    }
    if (~a[2] && ~a[3]) {
      for (int i = (1), _end_ = (2); i <= _end_; i++)
        for (int j = (0), _end_ = (2); j <= _end_; j++) {
          static int b[maxn];
          for (int th = (1), _end_ = (n); th <= _end_; th++) b[th] = a[th];
          if (b[1] == -1) b[1] = i;
          if (b[n] == -1) b[n] = j;
          vector<int> rlg = ask(b);
          if (((int)rlg.size()) >= 1) {
            a[1] = b[1];
            a[4] = b[4];
          }
        }
    } else {
      for (int i = (4), _end_ = (4); i <= _end_; i++) {
        cout << "? ";
        for (int j = (0), _end_ = (1); j <= _end_; j++) cout << mp[b[i][j]];
        cout << endl;
        int k = read();
        while (k--) {
          int x = read();
          a[x] = b[i][0];
          a[x + 1] = b[i][1];
        }
      }
      for (int i = (2), _end_ = (3); i <= _end_; i++)
        if (a[i] == -1) a[i] = 1;
      int Fi = 0;
      for (int i = (1), _end_ = (n); i <= _end_; i++)
        if (~a[i]) {
          Fi = i;
          break;
        }
      for (int j = (Fi + 1), _end_ = (n - 1); j <= _end_; j++) {
        if (~a[j]) continue;
        int lst = a[j - 1];
        assert(lst != 0);
        if (lst == 1) {
          a[j] = 1;
        } else {
          a[j] = 1;
        }
      }
      Fi = 0;
      for (int i = (n), _end_ = (1); i >= _end_; i--)
        if (~a[i]) {
          Fi = i;
          break;
        }
      for (int j = (Fi - 1), _end_ = (2); j >= _end_; j--) {
        if (~a[j]) continue;
        int lst = a[j + 1];
        assert(lst != 2);
        if (lst == 1) {
          a[j] = 1;
        } else {
          a[j] = 1;
        }
      }
      if (!(a[2] == 1 && a[3] == 1)) {
        static int b[maxn];
        for (int i = (1), _end_ = (n); i <= _end_; i++) b[i] = a[i];
        if (a[n] == -1) {
          b[n] = 0;
          if (ask(b).size() == 1)
            a[n] = 0;
          else
            a[n] = 1;
        }
        if (a[1] == -1) {
          b[1] = 2;
          if (ask(b).size() == 1)
            a[1] = 2;
          else
            a[1] = 1;
        }
      } else {
        printf("? HHH");
        cout << endl;
        int k = read();
        int vis[10] = {0};
        while (k--) vis[read()] = 1;
        a[2] = 1;
        a[3] = 1;
        if (a[1] == -1) {
          if (vis[1])
            a[1] = 1;
          else
            a[1] = 2;
        }
        if (a[n] == -1) {
          if (vis[2])
            a[n] = 1;
          else
            a[n] = 0;
        }
      }
    }
  }
  for (int i = (1), _end_ = (n); i <= _end_; i++)
    if (a[i] == -1) {
      cout << "! ";
      for (int i = (1), _end_ = (n); i <= _end_; i++) cout << "C";
      cout << endl;
    }
  cout << "! ";
  for (int i = (1), _end_ = (n); i <= _end_; i++) cout << mp[a[i]];
  cout << endl;
  if (!read()) exit(0);
}
int main() {
  int t = read();
  while (t--) {
    doing();
  }
  return 0;
}
