#include <bits/stdc++.h>
using namespace std;
map<long long int, long long int> mp, mk;
set<long long int> s1, s2;
vector<long long int> v, w;
long long int a[2000006], b[2000006], c[2000006];
string s = "", p = "", q = "";
char ch;
long long int m, n, d, i, j, k, l, r, x, t, y, u, e, f, g, h;
int main() {
  cin >> t;
  while (t--) {
    cin >> n;
    for (i = 1; i <= n; i++) cin >> a[i];
    for (i = 1; i <= n; i++) cin >> b[i];
    for (i = 1; i <= n; i++) cin >> c[i];
    v.push_back(a[1]);
    for (i = 2; i < n; i++) {
      if (v.size() >= n)
        break;
      else {
        if (v[v.size() - 1] != a[i]) {
          v.push_back(a[i]);
        } else if (v[v.size() - 1] != b[i]) {
          v.push_back(b[i]);
        } else if (v[v.size() - 1] != c[i])
          v.push_back(c[i]);
      }
    }
    d = v[v.size() - 1];
    if (a[n] != a[1] && a[n] != d)
      v.push_back(a[n]);
    else if (b[n] != d && b[n] != v[0])
      v.push_back(b[n]);
    else if (c[n] != d && c[n] != v[0])
      v.push_back(c[n]);
    for (i = 0; i < n; i++) cout << v[i] << " ";
    cout << endl;
    s1.clear();
    v.clear();
  }
}
