#include <bits/stdc++.h>
using namespace std;
void c_p_c() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
void solve() {
  long long n;
  cin >> n;
  long long a[n], b[n], c[n];
  for (long long i = 0; i < (n); ++i) cin >> a[i];
  for (long long i = 0; i < (n); ++i) cin >> b[i];
  for (long long i = 0; i < (n); ++i) cin >> c[i];
  cout << a[0] << " ";
  long long prev = a[0];
  long long s = a[0];
  for (long long i = 1; i <= (n - 2); ++i) {
    if (prev != a[i]) {
      cout << a[i] << " ";
      prev = a[i];
    } else if (prev != b[i]) {
      cout << b[i] << " ";
      prev = b[i];
    } else if (prev != c[i]) {
      cout << c[i] << " ";
      prev = c[i];
    }
  }
  if (a[n - 1] != a[0] and a[n - 1] != prev)
    cout << a[n - 1];
  else if (b[n - 1] != a[0] and b[n - 1] != prev)
    cout << b[n - 1];
  else if (c[n - 1] != a[0] and c[n - 1] != prev)
    cout << c[n - 1];
  cout << "\n";
}
int32_t main() {
  c_p_c();
  long long t;
  cin >> t;
  for (long long testcase = 0; testcase < (t); ++testcase) solve();
  return 0;
}
