#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n, j, k, l;
  cin >> t;
  for (int i = 0; i < t; i++) {
    cin >> n;
    int a[n];
    int b[n];
    int c[n];
    for (j = 0; j < n; j++) cin >> a[j];
    for (k = 0; k < n; k++) cin >> b[k];
    for (l = 0; l < n; l++) cin >> c[l];
    for (j = 0; j < n - 1; j++) {
      if (a[j] == a[j + 1]) a[j + 1] = b[j + 1];
    }
    if (a[0] == a[n - 1]) {
      if (b[0] == a[1])
        a[0] = c[0];
      else
        a[0] = b[0];
    }
    for (j = 0; j < n; j++) cout << a[j] << " ";
    cout << "\n";
  }
}
