#include <bits/stdc++.h>
using namespace std;
int sc1() {
  int x;
  scanf("%d", &x);
  return x;
}
long long sc2() {
  long long x;
  scanf("%lld", &x);
  return x;
}
const int mod = 1e9 + 7;
inline int add(int a, int b) {
  a += b;
  return a >= mod ? a - mod : a;
}
inline int sub(int a, int b) {
  a -= b;
  return a < 0 ? a + mod : a;
}
inline int mul(int a, int b) { return (long long)a * b % mod; }
void err(istream_iterator<string> it) { cout << endl; }
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << ", ";
  err(++it, args...);
}
const int inf = (int)2e9 + 5;
const long long Inf = (long long)1e18 + 5;
const int N = 5e6 + 5;
int solve() {
  int n = sc1();
  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];
  }
  int pre;
  for (int i = 0; i < n; i++) {
    if (i == 0) {
      cout << a[0] << " ";
      pre = a[0];
    } else if (i == n - 1) {
      if (a[i] != pre && a[0] != a[i]) {
        cout << a[i] << " ";
        pre = a[i];
      } else if (b[i] != pre && a[0] != b[i]) {
        cout << b[i] << " ";
        pre = b[i];
      } else if (c[i] != pre && a[0] != c[i]) {
        cout << c[i] << " ";
        pre = c[i];
      }
    } else {
      if (a[i] != pre) {
        cout << a[i] << " ";
        pre = a[i];
      } else if (b[i] != pre) {
        cout << b[i] << " ";
        pre = b[i];
      } else if (c[i] != pre) {
        cout << c[i] << " ";
        pre = c[i];
      }
    }
  }
  cout << endl;
  return 0;
}
int main() {
  int test = 1, tc = 0;
  scanf("%d", &test);
  while (test--) {
    solve();
  }
  return 0;
}
