#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<int> A(n);
  for (int _i = 0; _i < n; _i++) cin >> A[_i];
  vector<int> B(n);
  for (int _i = 0; _i < n; _i++) cin >> B[_i];
  vector<int> C(n);
  for (int _i = 0; _i < n; _i++) cin >> C[_i];
  vector<int> P(n);
  for (int i = 0; i <= n - 1; i++) P[i] = -1;
  for (int i = 0; i <= n - 1; i++) {
    if (P[(i + n - 1) % n] != A[i] && P[(i + 1) % n] != A[i]) {
      P[i] = A[i];
    } else if (P[(i + n - 1) % n] != B[i] && P[(i + 1) % n] != B[i]) {
      P[i] = B[i];
    } else if (P[(i + n - 1) % n] != C[i] && P[(i + 1) % n] != C[i]) {
      P[i] = C[i];
    }
  }
  for (int _i = 0; _i < P.size(); _i++) cout << P[_i] << " ";
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  for (int tt = 1; tt <= t; tt++) {
    solve();
  }
}
