#include <bits/stdc++.h>
using namespace std;
void print(int64_t a) { cout << a << '\t' << '\n'; }
void print(int64_t a, int64_t b) { cout << a << '\t' << b << '\t' << '\n'; }
void print(int64_t a, int64_t b, int64_t c) {
  cout << a << '\t' << b << '\t' << c << '\n';
}
void print(int64_t a, int64_t b, int64_t c, int64_t d) {
  cout << a << '\t' << b << '\t' << c << '\t' << d << '\n';
}
void print(int64_t a, int64_t b, int64_t c, int64_t d, int64_t e) {
  cout << a << '\t' << b << '\t' << c << '\t' << d << '\t' << e << '\n';
}
void print(vector<int64_t> &a) {
  for (auto i : a) cout << i << " ";
  cout << '\n';
}
void print(string s) { cout << s, cout << '\n'; }
void solve() {
  int64_t n;
  cin >> n;
  vector<int64_t> a(n), b(n), c(n);
  for (auto &i : a) cin >> i;
  ;
  for (auto &i : b) cin >> i;
  ;
  for (auto &i : c) cin >> i;
  ;
  int64_t X = 0;
  for (int64_t i = 0; i < n; i++) {
    if (i == n - 1) {
      if (a[i] != X && a[i] != a[0])
        cout << a[i] << ' ';
      else if (b[i] != X && b[i] != a[0])
        cout << b[i] << ' ';
      else
        cout << c[i] << ' ';
    } else {
      if (a[i] != X)
        cout << a[i] << ' ', X = a[i];
      else if (b[i] != X)
        cout << b[i] << ' ', X = b[i];
      else
        cout << c[i] << ' ', X = c[i];
    }
  }
  cout << '\n';
}
int32_t main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  ;
  int64_t t;
  cin >> t;
  while (t--) solve();
}
