#include <bits/stdc++.h>
using namespace std;
struct num {
  string x;
  string y;
};
long long pow(long long base, long long os) {
  if (os == 0) return 1;
  long long z = pow(base, os / 2);
  z *= z;
  return (os % 2 ? z * base : z);
}
bool isprime(int x) {
  for (long long i = 2; i * i <= x; i++) {
    if (x % i == 0) return false;
  }
  return true;
}
int prime[1000010] = {};
void sieve(int n) {
  for (int i = 2; i * i <= n; i++) {
    if (prime[i] == 0)
      for (int j = i * i; j <= n; j += i) {
        prime[j] = 1;
      }
  }
  for (int i = 2; i <= n; i++)
    if (prime[i] ^ 1) cout << (i);
}
long long a[5050], b[5050], c[5050];
void run_case() {
  int n;
  cin >> 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];
  long long ans[5050];
  ans[0] = a[0];
  for (int i = 1; i < n - 1; i++) {
    if (a[i] != ans[i - 1]) {
      ans[i] = a[i];
      continue;
    }
    if (b[i] != ans[i - 1]) {
      ans[i] = b[i];
      continue;
    }
    if (c[i] != ans[i - 1]) {
      ans[i] = c[i];
      continue;
    }
  }
  if (a[n - 1] != ans[n - 2] && a[n - 1] != ans[0])
    ans[n - 1] = a[n - 1];
  else if (b[n - 1] != ans[n - 2] && b[n - 1] != ans[0])
    ans[n - 1] = b[n - 1];
  else
    ans[n - 1] = c[n - 1];
  for (int i = 0; i < n; i++) cout << ans[i] << " \n"[i == n - 1];
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int tests = 1;
  cin >> tests;
  while (tests--) run_case();
}
