#include <bits/stdc++.h>
using namespace std;
string s, ans;
int m, q[500 + 5], cnt;
void check() {
  printf("? ");
  for (int i = 0; i < s.length(); i++) printf("%c", s[i]);
  printf("\n");
  fflush(stdout);
  scanf("%d", &m);
  for (int i = 1; i <= m; i++) scanf("%d", &q[i]);
}
int a[500 + 5];
char getc(int v) {
  if (v == 0) return '#';
  if (v == 1) return 'C';
  if (v == 2) return 'O';
  return 'H';
}
bool vis;
void dfs(int id) {
  if (id == 5) {
    if (vis) return;
    s.resize(4);
    for (int i = 1; i <= 4; i++) s[i - 1] = getc(a[i]);
    if (cnt != 5)
      check();
    else
      m = 1;
    if (m) {
      for (int i = 1; i <= 4; i++) ans[i - 1] = s[i - 1];
      vis = true;
    }
    cnt++;
    return;
  }
  if (a[id]) {
    dfs(id + 1);
    return;
  }
  for (int i = 1; i <= 3; i++) {
    if (i == 1 && id != 4) continue;
    a[id] = i;
    dfs(id + 1);
    a[id] = 0;
  }
}
int main() {
  int T;
  scanf("%d\n", &T);
  while (T--) {
    int n, i, j;
    scanf("%d", &n);
    memset(a, 0, sizeof(a));
    ans.resize(n);
    if (n != 4) {
      for (i = 1; i <= n; i++) a[i] = 3;
      a[1] = a[n] = 0;
      s = "CC";
      check();
      for (i = 1; i <= m; i++) a[q[i]] = 1;
      s = "CH";
      check();
      for (i = 1; i <= m; i++) a[q[i]] = 1;
      s = "CO";
      check();
      for (i = 1; i <= m; i++) a[q[i]] = 1, a[q[i] + 1] = 2;
      s = "HO";
      check();
      for (i = 1; i <= m; i++) a[q[i] + 1] = 2;
      s = "OO";
      check();
      for (i = 1; i <= m; i++) a[q[i] + 1] = 2;
      s.resize(n);
      for (i = 1; i <= n; i++) s[i - 1] = getc(a[i]);
      bool flag = false;
      if (a[1] == 0)
        for (i = 2; i <= 3; i++) {
          s[0] = getc(i);
          if (a[n] == 0) {
            for (j = 1; j <= 3; j++)
              if (j != 2) {
                s[n - 1] = getc(j);
                if (i + j != 6)
                  check();
                else
                  m = 1;
                if (m) {
                  flag = true;
                  break;
                }
              }
          } else {
            check();
            if (m) flag = true;
          }
          if (flag) break;
        }
      else {
        if (!a[n]) {
          for (j = 1; j <= 3; j++)
            if (j != 2) {
              s[n - 1] = getc(j);
              check();
              if (m) {
                flag = true;
                break;
              }
            }
        }
      }
      printf("! ");
      for (i = 0; i < s.length(); i++) printf("%c", s[i]);
      printf("\n");
      fflush(stdout);
      scanf("%d", &n);
    } else {
      cnt = 0;
      bool flag = false;
      vis = false;
      s = "CC";
      check();
      if (m) flag = true;
      for (i = 1; i <= m; i++) a[q[i]] = 1, a[q[i] + 1] = 1;
      s = "CH";
      check();
      if (m) flag = true;
      for (i = 1; i <= m; i++) a[q[i]] = 1, a[q[i] + 1] = 3;
      s = "CO";
      check();
      if (m) flag = true;
      for (i = 1; i <= m; i++) a[q[i]] = 1, a[q[i] + 1] = 2;
      s = "HO";
      check();
      if (m) flag = true;
      for (i = 1; i <= m; i++) a[q[i]] = 3, a[q[i] + 1] = 2;
      if (flag) {
        dfs(1);
        printf("! ");
        for (i = 0; i < ans.length(); i++) printf("%c", ans[i]);
        printf("\n");
        fflush(stdout);
        scanf("%d", &n);
        continue;
      }
      s = "OO";
      check();
      if (m) {
        for (i = 1; i <= m; i++) a[q[i]] = 2, a[q[i] + 1] = 2;
        if (!a[1]) a[1] = 3;
        if (!a[3]) a[3] = 3;
        s.resize(n);
        for (i = 1; i <= n; i++) s[i - 1] = getc(a[i]);
        if (!a[4]) {
          s[3] = 'C';
          check();
          if (!m) s[3] = 'H';
        }
        printf("! ");
        for (i = 0; i < n; i++) printf("%c", s[i]);
        printf("\n");
        fflush(stdout);
      } else {
        s = "HHH";
        check();
        if (!m)
          printf("! OHHC\n");
        else if (m == 1) {
          if (q[1] == 1)
            printf("! HHHC\n");
          else
            printf("! OHHH\n");
        } else
          printf("! HHHH\n");
        fflush(stdout);
      }
      scanf("%d", &n);
    }
  }
}
