#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long a[n], b[n], c[n], d[n];
    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];
    d[0] = a[0];
    for (long long i = 1; i < (n + 1) / 2; i++) {
      if (a[i] != d[i - 1])
        d[i] = a[i];
      else if (b[i] != d[i - 1])
        d[i] = b[i];
      else
        d[i] = c[i];
    }
    for (long long i = (n + 1) / 2; i < n; i++) {
      if (a[i] != d[i - 1] && a[i] != d[n - i - 1])
        d[i] = a[i];
      else if (b[i] != d[i - 1] && b[i] != d[n - i - 1])
        d[i] = b[i];
      else
        d[i] = c[i];
    }
    for (long long i = 0; i < n; i++) cout << d[i] << " ";
    cout << endl;
  }
}
