#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  vector<long long> b(n);
  vector<long long> 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];
  set<long long> st;
  cout << a[0] << " ";
  st.insert(a[0]);
  for (long long i = 1; i < n - 1; i++) {
    if (st.find(a[i]) == st.end()) {
      cout << a[i] << " ";
      st.clear();
      st.insert(a[i]);
    } else if (st.find(b[i]) == st.end()) {
      cout << b[i] << " ";
      st.clear();
      st.insert(b[i]);
    } else {
      cout << c[i] << " ";
      st.clear();
      st.insert(c[i]);
    }
  }
  st.insert(a[0]);
  if (st.find(a[n - 1]) == st.end())
    cout << a[n - 1] << " ";
  else if (st.find(b[n - 1]) == st.end())
    cout << b[n - 1] << " ";
  else
    cout << c[n - 1] << " ";
  st.clear();
  cout << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long t;
  cin >> t;
  while (t--) solve();
}
