#include <bits/stdc++.h>
using namespace std;
long long power(long long a, long long b) {
  long long result = 1;
  while (b > 0) {
    if ((b & 1) == 1) {
      result = result * a;
    }
    a = a * a;
    b = b >> 1;
  }
  return result;
}
void solve() {
  long long n;
  cin >> n;
  long long a[105];
  long long b[105];
  long long c[105];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (long long i = 0; i < n; i++) {
    cin >> b[i];
  }
  for (long long i = 0; i < n; i++) {
    cin >> c[i];
  }
  cout << a[0] << " ";
  long long i = 1;
  long long last = a[0];
  while (i < n) {
    if (i == n - 1) {
      if (a[i] != last && a[i] != a[0]) {
        cout << a[i] << " ";
        last = a[i];
      } else if (b[i] != last && b[i] != a[0]) {
        cout << b[i] << " ";
        last = b[i];
      } else if (c[i] != last && c[i] != a[0]) {
        cout << c[i] << " ";
        last = c[i];
      }
    } else {
      if (a[i] != last) {
        cout << a[i] << " ";
        last = a[i];
      } else if (b[i] != last) {
        cout << b[i] << " ";
        last = b[i];
      } else if (c[i] != last) {
        cout << c[i] << " ";
        last = c[i];
      }
    }
    i++;
  }
  cout << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
}
