#include <bits/stdc++.h>
using namespace std;
const int tINF = (int)INT_MAX;
const long long lINF = (long long)LLONG_MAX;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<vector<int>> ar(3, vector<int>(n));
    for (int i = 0; i < 3; ++i) {
      for (int j = 0; j < n; ++j) {
        cin >> ar[i][j];
      }
    }
    cout << ar[0][0] << " ";
    int ls = ar[0][0];
    for (int i = 1; i < n; ++i) {
      if (i == n - 1) {
        if (ar[0][i] == ls || ar[0][i] == ar[0][0]) {
          if (ar[1][i] == ls || ar[1][i] == ar[0][0]) {
            cout << ar[2][i] << ' ';
            ls = ar[1][i];
          } else {
            cout << ar[1][i] << ' ';
            ls = ar[1][i];
          }
        } else {
          cout << ar[0][i] << " ";
          ls = ar[0][i];
        }
      } else {
        if (ar[0][i] == ls) {
          if (ar[1][i] == ls) {
            cout << ar[2][i] << ' ';
            ls = ar[1][i];
          } else {
            cout << ar[1][i] << ' ';
            ls = ar[1][i];
          }
        } else {
          cout << ar[0][i] << " ";
          ls = ar[0][i];
        }
      }
    }
    cout << '\n';
  }
  if (false)
    cerr << "Time execute: " << (double)clock() / (double)CLOCKS_PER_SEC
         << " sec" << endl;
}
