#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n;
  cin >> t;
  while (t--) {
    cin >> n;
    int ar[4][n + 1];
    for (int i = 1; i <= 3; i++) {
      for (int j = 1; j <= n; j++) {
        cin >> ar[i][j];
      }
    }
    cout << ar[1][1];
    if (n == 1)
      cout << endl;
    else
      cout << " ";
    int before = 1, curr = 1;
    for (int i = 2; i < n; i++) {
      curr = 1;
      while (ar[curr][i] == ar[before][i - 1]) {
        curr++;
      }
      cout << ar[curr][i];
      cout << " ";
      before = curr;
    }
    if (n > 1) {
      curr = 1;
      while (ar[curr][n] == ar[before][n - 1] || ar[curr][n] == ar[1][1]) {
        curr++;
      }
      cout << ar[curr][n] << endl;
    }
  }
  return 0;
}
