#include <bits/stdc++.h>
using namespace std;
long long spf[1004];
void sieve() {
  spf[1] = 1;
  for (long long i = 2; i < 1004; i++) spf[i] = i;
  for (long long i = 4; i < 1004; i += 2) spf[i] = 2;
  for (long long i = 3; i * i < 1004; i++) {
    if (spf[i] == i) {
      for (long long j = i * i; j < 1004; j += i)
        if (spf[j] == j) spf[j] = i;
    }
  }
}
vector<long long> getFactorization(long long x) {
  vector<long long> ret;
  while (x != 1) {
    ret.push_back(spf[x]);
    x = x / spf[x];
  }
  return ret;
}
long long gcd(long long a, long long b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
long long __gcd(long long a, long long b) {
  if (b > a) {
    swap(a, b);
  }
  return gcd(a, b);
}
long long lcm(long long a, long long b) {
  long long lcm1 = (a / __gcd(a, b)) * b;
  return lcm1;
}
long long power(long long x, long long y) {
  long long res = 1;
  while (y > 0) {
    if (y & 1) {
      res = res * x;
    }
    y = y >> 1;
    x = x * x;
  }
  return res;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long a[n];
    long long b[n];
    long long c[n];
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
    }
    for (long long i = 0; i < n; i++) {
      cin >> b[i];
    }
    for (long long i = 0; i < n; i++) {
      cin >> c[i];
    }
    cout << a[0] << " ";
    long long prev = a[0];
    long long i = 1;
    while (i < n - 1) {
      if (prev == a[i]) {
        cout << b[i] << " ";
        prev = b[i];
      } else {
        cout << a[i] << " ";
        prev = a[i];
      }
      i++;
    }
    if (a[i] != prev && a[i] != a[0]) {
      cout << a[i];
    } else if (b[i] != prev && b[i] != a[0]) {
      cout << b[i];
    } else {
      cout << c[i];
    }
    cout << "\n";
  }
  return 0;
}
