#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n, i, j, prev = -1, first = -1;
  cin >> n;
  long long int a[n], b[n], c[n];
  vector<long long int> ans;
  vector<vector<long long int>> v;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (i = 0; i < n; i++) {
    cin >> b[i];
  }
  for (i = 0; i < n; i++) {
    cin >> c[i];
  }
  for (i = 0; i < n; i++) {
    v.push_back({a[i], b[i], c[i]});
    sort(v[i].begin(), v[i].end());
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < v[i].size(); j++) {
      if (i == n - 1) {
        if (v[i][j] != first && v[i][j] != prev) {
          ans.push_back(v[i][j]);
          break;
        }
      } else {
        if (v[i][j] != prev) {
          ans.push_back(v[i][j]);
          if (first == -1) first = v[i][j];
          prev = v[i][j];
          break;
        }
      }
    }
  }
  for (auto i : ans) {
    cout << i << " ";
  }
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t = 1;
  cin >> t;
  while (t--) solve();
  return 0;
}
