#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 5;
const int mod = 1e9 + 7;
long long qpow(long long a, long long b) {
  long long ans = 1;
  a %= mod;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) ans = ans * a % mod;
    a = a * a % mod;
  }
  return ans;
}
long long gcd(long long a, long long b) { return b > 0 ? gcd(b, a % b) : a; }
int n, m, T;
int a[maxn][3];
int p[maxn];
bool flag;
bool dfs() {
  for (int i = 2; i <= n; i++) {
    if (a[i][0] != p[i - 1])
      p[i] = a[i][0];
    else if (a[i][1] != p[i - 1])
      p[i] = a[i][1];
    else if (a[i][2] != p[i - 1])
      p[i] = a[i][2];
    else
      return 0;
  }
  if (p[n] == p[1]) return 0;
  return 1;
}
void print() {
  for (int i = 1; i <= n; i++) printf("%d ", p[i]);
  puts("");
}
int main() {
  cin >> T;
  while (T--) {
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i][0];
    for (int i = 1; i <= n; i++) cin >> a[i][1];
    for (int i = 1; i <= n; i++) cin >> a[i][2];
    for (int i = 1; i <= n; i++) {
      sort(a[i], a[i] + 3);
    }
    for (int i = 0; i < 3; i++) {
      p[1] = a[1][i];
      if (dfs()) {
        print();
        break;
      }
    }
  }
  return 0;
}
