#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char *name, Arg1 &&arg1) {
  cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char *names, Arg1 &&arg1, Args &&...args) {
  const char *comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
void i_o() {}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  i_o();
  int tt;
  cin >> tt;
  while (tt--) {
    int n;
    cin >> n;
    vector<int> a(n), b(n), c(n);
    for (int i = 0; i < n; i += 1) cin >> a[i];
    for (int i = 0; i < n; i += 1) cin >> b[i];
    for (int i = 0; i < n; i += 1) cin >> c[i];
    vector<int> ans(n);
    ans[0] = a[0];
    for (int i = 1; i < n; i += 1) {
      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] == ans[0] || ans[n - 1] == ans[n - 2]) {
      if (a[n - 1] != ans[0] && ans[n - 2] != a[n - 1])
        ans[n - 1] = a[n - 1];
      else if (b[n - 1] != ans[0] && ans[n - 2] != b[n - 1])
        ans[n - 1] = b[n - 1];
      else if (c[n - 1] != ans[0] && ans[n - 2] != c[n - 1])
        ans[n - 1] = c[n - 1];
    }
    for (int i = 0; i < n; i += 1) cout << ans[i] << " ";
    cout << endl;
  }
  return 0;
}
