#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<vector<int> > a;
    vector<int> temp;
    int l;
    for (int i = 0; i < n; i++) {
      cin >> l;
      temp.push_back(l);
    }
    a.push_back(temp);
    temp.clear();
    for (int i = 0; i < n; i++) {
      cin >> l;
      temp.push_back(l);
    }
    a.push_back(temp);
    temp.clear();
    for (int i = 0; i < n; i++) {
      cin >> l;
      temp.push_back(l);
    }
    a.push_back(temp);
    temp.clear();
    vector<int> p;
    int k = 0;
    for (int i = 0; i < n; i++) {
      if (i) {
        if (p[i - 1] == a[k][i]) k = (++k) % 3;
        while (i == n - 1 && (a[k][i] == p[0] || a[k][i] == p[i - 1])) {
          k = (++k) % 3;
        }
        p.push_back(a[k][i]);
      } else
        p.push_back(a[k][i]);
    }
    for (int j = 0; j < n; j++) {
      cout << p[j] << " ";
    }
    cout << endl;
    p.clear();
    a[0].clear();
    a[1].clear();
    a[2].clear();
    a.clear();
  }
  return 0;
}
