#include <bits/stdc++.h>
using namespace std;
long long t, n, m, k, ccnt,
    sum = 0, cnt2 = 0, cnt3 = 0, cnt4 = 0, vis[100005], a[1000005], b[1000005],
    c[1000005], te[105], kk[1000005], cnt = 0, x, y, z, d = 0,
    minn = LONG_LONG_MAX, maxx = -INT_MAX, pos1 = -1, pos2 = -1, tem, tem2, l,
    r, ans = 0, ans2, mod = 1000000007, tw[105], th[105], dd, sw[85][85];
vector<long long> v[100005];
double ee;
string s;
int main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(0);
  cin >> t;
  while (t--) {
    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];
    kk[0] = a[0];
    for (int i = 1; i < n; i++) {
      if (i != n - 1) {
        if (a[i] != kk[i - 1]) {
          kk[i] = a[i];
        } else {
          kk[i] = b[i];
        }
      } else {
        if (a[i] != kk[i - 1] && a[i] != kk[0]) {
          kk[i] = a[i];
        } else if (b[i] != kk[i - 1] && b[i] != kk[0]) {
          kk[i] = b[i];
        } else {
          kk[i] = c[i];
        }
      }
    }
    for (int i = 0; i < n; i++) {
      cout << kk[i] << " ";
    }
    cout << '\n';
  }
}
