#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
void solve() {
  int n;
  cin >> n;
  vector<int> a(n), b(n), c(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) cin >> b[i];
  for (int i = 0; i < n; i++) cin >> c[i];
  vector<int> res;
  for (int i = 0; i < n; i++) {
    if (res.size() == 0)
      res.push_back(a[i]);
    else {
      if (a[i] != res[i - 1])
        res.push_back(a[i]);
      else if (b[i] != res[i - 1])
        res.push_back(b[i]);
      else
        res.push_back(c[i]);
    }
  }
  if (res.front() == res.back()) {
    if (a.front() != res.back() && a.front() != res[1])
      res.front() = a.front();
    else if (b.front() != res.back() && b.front() != res[1])
      res.front() = b.front();
    else
      res.front() = c.front();
  }
  for (auto x : res) cout << x << ' ';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    solve();
    cout << "\n";
  }
  return 0;
}
