#include <bits/stdc++.h>
using namespace std;
void c_p_c() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int main() {
  c_p_c();
  int x;
  cin >> x;
  while (x--) {
    int n;
    cin >> n;
    set<int> s;
    vector<int> a(n), b(n), c(n);
    for (int i = 0; i <= n - 1; i++) cin >> a[i];
    for (int i = 0; i <= n - 1; i++) cin >> b[i];
    for (int i = 0; i <= n - 1; i++) cin >> c[i];
    vector<int> v(n);
    v[0] = a[0];
    for (int i = 1; i < n - 1; i++) {
      if (v[i - 1] != a[i]) {
        v[i] = a[i];
      } else if (v[i - 1] != b[i]) {
        v[i] = b[i];
      } else if (v[i - 1] != c[i]) {
        v[i] = c[i];
      }
    }
    if (v[n - 2] != a[n - 1] && v[0] != a[n - 1]) {
      v[n - 1] = a[n - 1];
    } else if (v[n - 2] != b[n - 1] && v[0] != b[n - 1]) {
      v[n - 1] = b[n - 1];
    } else if (v[n - 2] != c[n - 1] && v[0] != c[n - 1]) {
      v[n - 1] = c[n - 1];
    }
    for (auto var : v) {
      cout << var << " ";
    }
    cout << endl;
  }
  return 0;
}
