#include <bits/stdc++.h>
static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;
template <class T>
constexpr T INF = ::numeric_limits<T>::max() / 32 * 15 + 208;
void solve() {
  int n;
  cin >> n;
  vector<int> A(n), B(n), C(n);
  for (auto &&i : A) scanf("%d", &i);
  for (auto &&i : B) scanf("%d", &i);
  for (auto &&i : C) scanf("%d", &i);
  vector<int> ans(n);
  ans[0] = A[0];
  for (int i = 1; i < n; ++i) {
    if (ans[i - 1] != A[i]) ans[i] = A[i];
    if (ans[i - 1] != B[i]) ans[i] = B[i];
    if (ans[i - 1] != C[i]) ans[i] = C[i];
  }
  if (ans[n - 2] != A[n - 1] && ans[0] != A[n - 1]) ans[n - 1] = A[n - 1];
  if (ans[n - 2] != B[n - 1] && ans[0] != B[n - 1]) ans[n - 1] = B[n - 1];
  if (ans[n - 2] != C[n - 1] && ans[0] != C[n - 1]) ans[n - 1] = C[n - 1];
  for (int i = 0; i < n; ++i) {
    if (i) printf(" ");
    printf("%d", ans[i]);
  }
  puts("");
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
