#include <bits/stdc++.h>
using namespace std;
long long int power(long long int b, long long int e, long long int m) {
  if (e == 0) return 1;
  if (e & 1) return b * power(b * b % m, e / 2, m) % m;
  return power(b * b % m, e / 2, m);
}
long long int power(long long int b, long long int e) {
  if (e == 0) return 1;
  if (e & 1) return b * power(b * b, e / 2);
  return power(b * b, e / 2);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    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];
    int p1 = -1;
    int p[n];
    for (int i = 0; i < n - 1; i++) {
      if (a[i] != p1)
        p[i] = a[i];
      else if (b[i] != p1)
        p[i] = b[i];
      else
        p[i] = c[i];
      p1 = p[i];
    }
    if (a[n - 1] != p1 && a[n - 1] != p[0])
      p[n - 1] = a[n - 1];
    else if (b[n - 1] != p1 && b[n - 1] != p[0])
      p[n - 1] = b[n - 1];
    else if (c[n - 1] != p1 && c[n - 1] != p[0])
      p[n - 1] = c[n - 1];
    for (int i = 0; i < n; i++) cout << p[i] << " ";
    cout << "\n";
  }
  return 0;
}
