#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;

typedef long long ll;
typedef vector<int> vint;
typedef vector<long long> vll;
typedef pair<int,int> pint;
typedef pair<long long, long long> pll;

#define MP make_pair
#define PB push_back
#define ALL(s) (s).begin(),(s).end()
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P) 
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P) 
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P) 
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P) 
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s; }

inline int gcd(int a, int b) {
    if (b == 0) return a;
    if (a < 0) a = -a; if (b < 0) b = -b;
    return gcd(b, a % b);
}
inline int lcm(int a, int b) {
    int g = gcd(a, b);
    return a * b / g;
}
struct frac {
    int first, second;
    
    frac normalize() {
        if (second < 0) {first = -first; second = -second;}
        int d = gcd(first, second);
        if (d == 0) {first = 0; second = 1;}
        else {first /= d; second /= d;}
        return *this;
    }
    frac(int f = 0, int s = 1) : first(f), second(s) { normalize(); }
    inline frac operator - () { (*this).first *= -1; return (*this); }
    inline const frac& operator = (int a) { *this = frac(a, 1); return *this; }
    inline const frac& operator += (const frac& a);
    inline const frac& operator += (int a);
    inline const frac& operator -= (const frac& a);
    inline const frac& operator -= (int a);
    inline const frac& operator *= (const frac& a);
    inline const frac& operator *= (int a);
    inline const frac& operator /= (const frac& a);
    inline const frac& operator /= (int a);
    friend ostream& operator << (ostream& s, const frac& f) { 
        s << f.first; if (f.second != 1) s << "/" << f.second; return s;
    }
};
bool operator < (const frac& a, const frac& b) {
    return a.first * b.second < a.second * b.first;
}
bool operator > (const frac& a, const frac& b) { return b < a; }
bool operator <= (const frac& a, const frac& b) { return !(b < a); }
bool operator >= (const frac& a, const frac& b) { return !(a < b); }
bool operator != (const frac& a, const frac& b) { return a < b || b < a; }
bool operator == (const frac& a, const frac& b) { return !(a < b) && !(b < a); }

int CASE;

int BASE[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
string str;

int main() {
    //freopen( "/Users/macuser/Dropbox/Contest/input.in", "r", stdin );
    cin >> CASE;
    for (int AAA = 0; AAA < CASE; ++AAA) {
        int n; cin >> n;
        map<frac,int> ma;
        for (int i = 0; i < n; ++i) {
            cin >> str;
            int bo = str.size();
            for (int k = 0; k < str.size(); k += 2) {
                string sub = str.substr(k, 2);
                int num = 0;
                for (int l = 0; l < 16; ++l) {
                    if (BASE[l] == sub[0]) num += l * 16;
                    if (BASE[l] == sub[1]) num += l;
                }
                if (num != 0) ma[ frac(k/2, bo/2) ] += num;
            }
        }
        int LCM = 1;
        
        bool ok = true;
        EACH(it,ma) {
            LCM = lcm(LCM, it->first.second);
            if (LCM > 1024) ok = false;
        }

        if (!ok) puts("Too complex.");
        else {
            string res = "";
            for (int i = 0; i < LCM*2; ++i) res += '0';
            EACH(it,ma) {
                int pos = (it->first.first) * LCM / (it->first.second);
                int num = it->second;
            
                char c1 = BASE[num/16];
                char c2 = BASE[num%16];
            
                res[pos*2] = c1;
                res[pos*2+1] = c2;
            }
            cout << res << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 1540