#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int t;
  cin >> t;
  while (t-- > 0) {
    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 x = a[n - 1];
    a[0] = min(a[0], min(b[0], c[0]));
    for (int i = 1; i < n; i++) {
      int mx = max(a[i], max(b[i], c[i]));
      int mn = min(a[i], min(b[i], c[i]));
      if (a[i - 1] == mx)
        a[i] = mn;
      else
        a[i] = mx;
    }
    if (a[n - 1] == a[0]) {
      if ((x != a[n - 2]) && (x != a[0])) a[n - 1] = x;
      if ((b[n - 1] != a[n - 2]) && (b[n - 1] != a[0])) a[n - 1] = b[n - 1];
      if ((c[n - 1] != a[n - 2]) && (c[n - 1] != a[0])) a[n - 1] = c[n - 1];
    }
    for (int i = 0; i < n; i++) {
      cout << a[i] << " ";
    }
    cout << endl;
  }
  return 0;
}
