#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cout << name << " : " << arg1 << '\n';
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
int inf = 0x3f3f3f3f;
long long infl = 0x3f3f3f3f3f3f3f3fLL;
long double infd = 1.0 / 0.0;
const long long MOD = 1e9 + 7;
const long double pi = 2 * acos(0.0);
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  ;
  int tt = 1;
  cin >> tt;
  while (tt--) {
    int n;
    cin >> n;
    vector<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];
    vector<int> as(n);
    as[0] = a[0];
    for (int i = 1; i < n; i++) {
      if (a[i] != as[i - 1]) {
        as[i] = a[i];
        continue;
      }
      if (b[i] != as[i - 1]) {
        as[i] = b[i];
        continue;
      }
      if (c[i] != as[i - 1]) {
        as[i] = c[i];
        continue;
      }
    }
    if (as[n - 1] == as[0]) {
      if (as[n - 2] != a[n - 1] && a[n - 1] != as[0]) {
        as[n - 1] = a[n - 1];
      }
      if (as[n - 2] != b[n - 1] && b[n - 1] != as[0]) {
        as[n - 1] = b[n - 1];
      }
      if (as[n - 2] != c[n - 1] && c[n - 1] != as[0]) {
        as[n - 1] = c[n - 1];
      }
    }
    for (int i = 0; i < n; i++) cout << as[i] << ' ';
    cout << '\n';
  }
  return 0;
}
