#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long int test, n, temp, i, j;
  cin >> test;
  while (test--) {
    cin >> n;
    long long int arr[n], brr[n], crr[n], p[n];
    for (i = 0; i < n; i++) cin >> arr[i];
    for (i = 0; i < n; i++) cin >> brr[i];
    for (i = 0; i < n; i++) cin >> crr[i];
    p[0] = arr[0];
    for (i = 1; i < n; i++) {
      if (p[i - 1] == arr[i]) {
        p[i] = brr[i];
        if (i == n - 1) {
          if (p[i] == p[0]) p[i] = crr[i];
        }
      } else {
        p[i] = arr[i];
        if (i == n - 1) {
          if (p[i] == p[0]) {
            if (p[i - 1] != brr[i])
              p[i] = brr[i];
            else
              p[i] = crr[i];
          }
        }
      }
    }
    for (i = 0; i < n; i++) cout << p[i] << " ";
    cout << endl;
  }
}
