#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t, tc, i, j, k, l, n, m, x, y, u, v, w, mod;
  cin >> t;
  for (tc = 1; tc <= t; tc++) {
    cin >> n;
    vector<long long int> a(n), b(n), c(n), ans(n);
    for (i = 0; i < n; i++) cin >> a[i];
    for (i = 0; i < n; i++) cin >> b[i];
    for (i = 0; i < n; i++) cin >> c[i];
    ans[0] = a[0];
    for (i = 1; i < n - 1; i++) {
      if (b[i] != ans[i - 1]) {
        ans[i] = b[i];
      } else if (a[i] != ans[i - 1]) {
        ans[i] = a[i];
      } else {
        ans[i] = c[i];
      }
    }
    if (b[i] != ans[i - 1] && b[i] != ans[0]) {
      ans[i] = b[i];
    } else if (a[i] != ans[i - 1] && a[i] != ans[0]) {
      ans[i] = a[i];
    } else {
      ans[i] = c[i];
    }
    for (i = 0; i < n; i++) cout << ans[i] << " ";
    cout << endl;
  }
  return 0;
}
