#include <bits/stdc++.h>
using namespace std;
long long int sil(double x) {
  long long int z = x;
  if (z == x) return z;
  return z + 1;
}
void faster(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
void solve() {
  long long int n, t, i, j, h, l, k, sz, q = -1, sz0, p = 0, m, o, d, x, y, z,
                                         r, g, b, w, sz2;
  char ch;
  string s, s2;
  vector<long long int> v;
  long long int sm = 0, f = 1, sm2 = 0, c = 0, cn = 0, mx = -10000000000,
                mx2 = -10000000000, mn = 1007, mn2 = mn;
  map<char, long long int> mp;
  cin >> n;
  for (i = 0; i <= n - 1; i++) {
    cin >> s;
    sz2 = s.size();
    for (j = 0; j <= sz2 - 1; j++) mp[s[j]]++;
  }
  if (mp['a'] % n) c++;
  if (mp['b'] % n) c++;
  if (mp['c'] % n) c++;
  if (mp['d'] % n) c++;
  if (mp['e'] % n) c++;
  if (mp['f'] % n) c++;
  if (mp['g'] % n) c++;
  if (mp['h'] % n) c++;
  if (mp['i'] % n) c++;
  if (mp['j'] % n) c++;
  if (mp['k'] % n) c++;
  if (mp['l'] % n) c++;
  if (mp['m'] % n) c++;
  if (mp['n'] % n) c++;
  if (mp['o'] % n) c++;
  if (mp['p'] % n) c++;
  if (mp['q'] % n) c++;
  if (mp['r'] % n) c++;
  if (mp['s'] % n) c++;
  if (mp['t'] % n) c++;
  if (mp['u'] % n) c++;
  if (mp['v'] % n) c++;
  if (mp['w'] % n) c++;
  if (mp['x'] % n) c++;
  if (mp['y'] % n) c++;
  if (mp['z'] % n) c++;
  if (c)
    cout << "NO";
  else
    cout << "YES";
  cout << "\n";
}
int main() {
  faster();
  long long int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
