- #include "bits/stdc++.h"
- // #pragma GCC optimize("O3,unroll-loops")
- // #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
- using namespace std;
- using ll = long long int;
- mt19937_64 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
-
- struct input_checker {
- string buffer;
- int pos;
-
- const string all = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
- const string number = "0123456789";
- const string upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
- const string lower = "abcdefghijklmnopqrstuvwxyz";
-
- input_checker() {
- pos = 0;
- while (true) {
- int c = cin.get();
- if (c == -1) {
- break;
- }
- buffer.push_back((char) c);
- }
- }
-
- int nextDelimiter() {
- int now = pos;
- while (now < (int) buffer.size() && buffer[now] != ' ' && buffer[now] != '\n') {
- now++;
- }
- return now;
- }
-
- string readOne() {
- assert(pos < (int) buffer.size());
- int nxt = nextDelimiter();
- string res;
- while (pos < nxt) {
- res += buffer[pos];
- pos++;
- }
- // cerr << res << endl;
- return res;
- }
-
- string readString(int minl, int maxl, const string &pattern = "") {
- assert(minl <= maxl);
- string res = readOne();
- assert(minl <= (int) res.size());
- assert((int) res.size() <= maxl);
- for (int i = 0; i < (int) res.size(); i++) {
- assert(pattern.empty() || pattern.find(res[i]) != string::npos);
- }
- return res;
- }
-
- int readInt(int minv, int maxv) {
- assert(minv <= maxv);
- int res = stoi(readOne());
- assert(minv <= res);
- assert(res <= maxv);
- return res;
- }
-
- long long readLong(long long minv, long long maxv) {
- assert(minv <= maxv);
- long long res = stoll(readOne());
- assert(minv <= res);
- assert(res <= maxv);
- return res;
- }
-
- void readSpace() {
- assert((int) buffer.size() > pos);
- assert(buffer[pos] == ' ');
- pos++;
- }
-
- void readEoln() {
- assert((int) buffer.size() > pos);
- assert(buffer[pos] == '\n');
- pos++;
- }
-
- void readEof() {
- assert((int) buffer.size() == pos);
- }
- };
-
- int main()
- {
- ios::sync_with_stdio(false); cin.tie(0);
-
- input_checker inp;
-
- map<string,char> mp = {
- {"00", 'A'}, {"01", 'T'}, {"10", 'C'}, {"11", 'G'}
- };
-
- int t = inp.readInt(1, 100); inp.readEoln();
- int sumN = 0;
- while (t--) {
- int n = inp.readInt(2, 1000); inp.readEoln();
- sumN += n;
- assert(n%2 == 0);
-
- string s = inp.readString(n, n, "01"); inp.readEoln();
- for (int i = 0; i < n; i += 2) cout << mp[s.substr(i, 2)];
- cout << '\n';
- }
- inp.readEof();
- }