#include <bits/stdc++.h>
using namespace std;
long long max(long long a, long long b) {
  if (a > b)
    return a;
  else
    return b;
}
long long min(long long a, long long b) {
  if (a < b)
    return a;
  else
    return b;
}
long long lowbit(long long x) { return x & (-x); }
long long prime(long long x) {
  if (x <= 1) return false;
  for (int i = 2; i <= int(sqrt(x)); i++) {
    if (x % i == 0) return false;
  }
  return true;
}
bool cmp(long long a, long long b) { return a > b; }
long long gcd(long long a, long long b) {
  long long r;
  while (b > 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
long long powmod(long long a, long long b, long long mod) {
  long long res = 1;
  a %= mod;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
inline int readint() {
  char c = getchar();
  int w = 1;
  int x = 0;
  while (!isdigit(c)) (c == '-') && (w = -w), c = getchar();
  while (isdigit(c)) x = (x << 3) + (x << 1) + (c ^ '0'), c = getchar();
  x *= w;
  return x;
}
inline long long readll() {
  char c = getchar();
  long long w = 1;
  long long x = 0;
  while (!isdigit(c)) (c == '-') && (w = -w), c = getchar();
  while (isdigit(c)) x = (x << 3) + (x << 1) + (c ^ '0'), c = getchar();
  x *= w;
  return x;
}
void fl(string name) {
  freopen((name + ".in").c_str(), "r", stdin);
  freopen((name + ".out").c_str(), "w", stdout);
}
const int dx[8] = {-1, 1, 0, 0, -1, 1, -1, 1},
          dy[8] = {0, 0, -1, 1, -1, -1, 1, 1};
int main() {
  long long q;
  cin >> q;
  while (q--) {
    long long n;
    cin >> n;
    long long a[n + 1], b[n + 1], c[n + 1], p[n + 1];
    for (long long i = 1; i <= n; i++) cin >> a[i];
    for (long long i = 1; i <= n; i++) cin >> b[i];
    for (long long i = 1; i <= n; i++) cin >> c[i];
    p[1] = a[1];
    for (long long i = 1; i <= n; i++) {
      if (a[i] != p[i - 1]) {
        p[i] = a[i];
        continue;
      }
      if (b[i] != p[i - 1]) {
        p[i] = b[i];
        continue;
      }
      if (c[i] != p[i - 1]) {
        p[i] = c[i];
        continue;
      }
    }
    long long flag = 0;
    if (a[n] != p[1] && p[n - 1] != a[n]) {
      p[n] = a[n];
      flag = 1;
    }
    if (b[n] != p[1] && p[n - 1] != b[n] && !flag) {
      p[n] = b[n];
      flag = 1;
    }
    if (c[n] != p[1] && p[n - 1] != c[n] && !flag) {
      p[n] = c[n];
    }
    for (long long i = 1; i <= n; i++) cout << p[i] << ' ';
    cout << '\n';
  }
  return 0;
}
