#include <bits/stdc++.h>
using namespace std;
namespace my_template {
const long double PI =
    3.14159265358979323846264338327950288419716939937510582097494L;
template <typename T>
pair<T, T> operator+(const pair<T, T> &a, const pair<T, T> &b) {
  return pair<T, T>(a.first + b.first, a.second + b.second);
}
template <typename T>
pair<T, T> operator-(const pair<T, T> &a, const pair<T, T> &b) {
  return pair<T, T>(a.first - b.first, a.second - b.second);
}
template <typename T>
T operator*(const pair<T, T> &a, const pair<T, T> &b) {
  return (a.first * b.first + a.second * b.second);
}
template <typename T>
T operator^(const pair<T, T> &a, const pair<T, T> &b) {
  return (a.first * b.second - a.second * b.first);
}
template <typename T>
void print(vector<T> vec, string name = "") {
  cout << name;
  for (auto u : vec) cout << u << ' ';
  cout << '\n';
}
}  // namespace my_template
using namespace my_template;
const int MOD = 1000000007;
const long long INF = std::numeric_limits<long long>::max();
const int MX = 100101;
void solve() {
  int N;
  cin >> N;
  vector<int> sk[3];
  sk[0] = sk[1] = sk[2] = vector<int>(N);
  for (int i = 0; i < 3; ++i) {
    for (int j = 0; j < N; ++j) {
      cin >> sk[i][j];
    }
  }
  vector<int> ats(N);
  ats[0] = sk[0][0];
  for (int i = 1; i < N; ++i) {
    if (ats[i - 1] != sk[0][i]) {
      ats[i] = sk[0][i];
    } else {
      ats[i] = sk[1][i];
    }
  }
  for (int i = 0; i < 3; ++i) {
    if (sk[i][0] != ats[1] and sk[i][0] != ats[N - 1]) {
      ats[0] = sk[i][0];
      break;
    }
  }
  for (auto u : ats) printf("%d ", u);
  printf("\n");
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int T;
  cin >> T;
  while (T--) solve();
}
