#include <bits/stdc++.h>
using namespace std;
void testCase() {
  long long n;
  cin >> n;
  vector<long long> a(n), b(n), 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];
  }
  vector<long long> ans(n);
  for (long long i = 0; i < n; i++) {
    if (i == 0) {
      ans[i] = a[i];
    } else {
      if (a[i] != ans[i - 1]) {
        ans[i] = a[i];
      } else if (b[i] != ans[i - 1]) {
        ans[i] = b[i];
      } else if (c[i] != ans[i - 1]) {
        ans[i] = c[i];
      }
    }
  }
  if (ans[n - 1] == a[0]) {
    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 if (c[n - 1] != ans[n - 2] && c[n - 1] != ans[0]) {
      ans[n - 1] = c[n - 1];
    }
  }
  for (auto x : ans) {
    cout << x << ' ';
  }
  cout << '\n';
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  cin >> t;
  while (t--) testCase();
  return 0;
}
