#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, k, p = 0, c = 0, s = 0, d = 0;
  int t;
  cin >> t;
  while (t--) {
    cin >> n;
    set<int> s;
    long long int a[n], b[n], c[n], p[n];
    for (long long int i = 0; i < n; i++) {
      cin >> a[i];
    }
    for (long long int i = 0; i < n; i++) {
      cin >> b[i];
    }
    for (long long int i = 0; i < n; i++) {
      cin >> c[i];
    }
    p[0] = a[0];
    long long int pr = a[0];
    for (int i = 1; i < n - 1; i++) {
      if (a[i] != pr) {
        p[i] = a[i];
        pr = a[i];
      } else if (b[i] != pr) {
        p[i] = b[i];
        pr = b[i];
      } else if (c[i] != pr) {
        p[i] = c[i];
        pr = c[i];
      }
    }
    if (a[n - 1] != pr && a[n - 1] != a[0])
      p[n - 1] = a[n - 1];
    else if (b[n - 1] != pr && b[n - 1] != p[0])
      p[n - 1] = b[n - 1];
    else if (c[n - 1] != pr && c[n - 1] != p[0])
      p[n - 1] = c[n - 1];
    for (auto i : p) {
      cout << i << " ";
    }
    cout << endl;
  }
  return 0;
}
