#include <bits/stdc++.h>
using ll = long long;
using namespace std;
void D() {
  set<int> s;
  ll n;
  cin >> n;
  vector<int> a, b, c;
  ll x;
  for (int i = 0; i < n; i++) {
    cin >> x;
    a.push_back(x);
  }
  for (int i = 0; i < n; i++) {
    cin >> x;
    b.push_back(x);
  }
  for (int i = 0; i < n; i++) {
    cin >> x;
    c.push_back(x);
  }
  ll prev = -21313;
  vector<int> res;
  for (int i = 0; i < n; i++) {
    if (b[i] != prev) {
      res.push_back(b[i]);
      prev = b[i];
    } else if (c[i] != prev) {
      res.push_back(c[i]);
      prev = c[i];
    } else {
      res.push_back(a[i]);
      prev = a[i];
    }
  }
  if (a[n - 1] != res[0] and a[n - 1] != res[n - 2])
    res[n - 1] = a[n - 1];
  else if (b[n - 1] != res[0] and b[n - 1] != res[n - 2])
    res[n - 1] = b[n - 1];
  else if (c[n - 1] != res[0] and c[n - 1] != res[n - 2])
    res[n - 1] = c[n - 1];
  for (auto i : res) cout << i << " ";
  cout << "\n";
  ;
}
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.precision(0);
  cout << fixed;
  ll n, m, k, pt(0), ct(0), x, y;
  ll t = 1;
  cin >> t;
  while (t--) {
    D();
  }
}
