#include <bits/stdc++.h>
using namespace std;
vector<long long> a;
vector<long long> b;
vector<long long> c;
long long n;
void solve() {
  a.clear();
  b.clear();
  c.clear();
  cin >> n;
  for (int i = 0; i < n; i++) {
    long long z;
    cin >> z;
    a.push_back(z);
  }
  for (int i = 0; i < n; i++) {
    long long z;
    cin >> z;
    b.push_back(z);
  }
  for (int i = 0; i < n; i++) {
    long long z;
    cin >> z;
    c.push_back(z);
  }
  cout << a[0] << " ";
  int last = a[0];
  for (int i = 1; i < n - 1; i++) {
    if (a[i] == last) {
      cout << b[i] << " ";
      last = b[i];
    } else {
      cout << a[i] << " ";
      last = a[i];
    }
  }
  if (a[n - 1] != last && a[n - 1] != a[0])
    cout << a[n - 1];
  else if (b[n - 1] != last && b[n - 1] != a[0])
    cout << b[n - 1];
  else
    cout << c[n - 1];
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
