#include <bits/stdc++.h>
using namespace std;
void testcase() {
  int n;
  cin >> n;
  int t;
  int a[n], b[n], c[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) cin >> b[i];
  for (int i = 0; i < n; i++) cin >> c[i];
  t = a[0];
  cout << a[0] << " ";
  for (int i = 1; i < n - 1; i++) {
    if (a[i] == t) {
      t = b[i];
      cout << t << " ";
    } else {
      t = a[i];
      cout << t << " ";
    }
  }
  if (t != a[n - 1] && a[n - 1] != a[0])
    cout << a[n - 1];
  else if (t != b[n - 1] && b[n - 1] != a[0])
    cout << b[n - 1];
  else
    cout << c[n - 1];
  cout << "\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int q = 1;
  cin >> q;
  while (q--) {
    testcase();
  }
  return 0;
}
