1. #include "bits/stdc++.h"
  2. // #pragma GCC optimize("O3,unroll-loops")
  3. // #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
  4. using namespace std;
  5. using ll = long long int;
  6. mt19937_64 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
  7.  
  8. struct input_checker {
  9. string buffer;
  10. int pos;
  11.  
  12. const string all = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
  13. const string number = "0123456789";
  14. const string upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  15. const string lower = "abcdefghijklmnopqrstuvwxyz";
  16.  
  17. input_checker() {
  18. pos = 0;
  19. while (true) {
  20. int c = cin.get();
  21. if (c == -1) {
  22. break;
  23. }
  24. buffer.push_back((char) c);
  25. }
  26. }
  27.  
  28. int nextDelimiter() {
  29. int now = pos;
  30. while (now < (int) buffer.size() && buffer[now] != ' ' && buffer[now] != '\n') {
  31. now++;
  32. }
  33. return now;
  34. }
  35.  
  36. string readOne() {
  37. assert(pos < (int) buffer.size());
  38. int nxt = nextDelimiter();
  39. string res;
  40. while (pos < nxt) {
  41. res += buffer[pos];
  42. pos++;
  43. }
  44. // cerr << res << endl;
  45. return res;
  46. }
  47.  
  48. string readString(int minl, int maxl, const string &pattern = "") {
  49. assert(minl <= maxl);
  50. string res = readOne();
  51. assert(minl <= (int) res.size());
  52. assert((int) res.size() <= maxl);
  53. for (int i = 0; i < (int) res.size(); i++) {
  54. assert(pattern.empty() || pattern.find(res[i]) != string::npos);
  55. }
  56. return res;
  57. }
  58.  
  59. int readInt(int minv, int maxv) {
  60. assert(minv <= maxv);
  61. int res = stoi(readOne());
  62. assert(minv <= res);
  63. assert(res <= maxv);
  64. return res;
  65. }
  66.  
  67. long long readLong(long long minv, long long maxv) {
  68. assert(minv <= maxv);
  69. long long res = stoll(readOne());
  70. assert(minv <= res);
  71. assert(res <= maxv);
  72. return res;
  73. }
  74.  
  75. void readSpace() {
  76. assert((int) buffer.size() > pos);
  77. assert(buffer[pos] == ' ');
  78. pos++;
  79. }
  80.  
  81. void readEoln() {
  82. assert((int) buffer.size() > pos);
  83. assert(buffer[pos] == '\n');
  84. pos++;
  85. }
  86.  
  87. void readEof() {
  88. assert((int) buffer.size() == pos);
  89. }
  90. };
  91.  
  92. int main()
  93. {
  94. ios::sync_with_stdio(false); cin.tie(0);
  95.  
  96. input_checker inp;
  97. map<string,char> mp = {
  98. {"00", 'A'}, {"01", 'T'}, {"10", 'C'}, {"11", 'G'}
  99. };
  100.  
  101. int t = inp.readInt(1, 100); inp.readEoln();
  102. int sumN = 0;
  103. while (t--) {
  104. int n = inp.readInt(2, 1000); inp.readEoln();
  105. sumN += n;
  106. assert(n%2 == 0);
  107.  
  108. string s = inp.readString(n, n, "01"); inp.readEoln();
  109. for (int i = 0; i < n; i += 2) cout << mp[s.substr(i, 2)];
  110. cout << '\n';
  111. }
  112. inp.readEof();
  113. }