#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    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 temp = a[0];
    cout << a[0] << " ";
    for (int i = 1; i < n; i++) {
      if (i < n - 1) {
        if (temp != a[i])
          temp = a[i];
        else if (temp != b[i])
          temp = b[i];
        else if (temp != c[i])
          temp = c[i];
      } else if (i == n - 1) {
        if (temp != a[i] and a[i] != a[0])
          temp = a[i];
        else if (temp != b[i] and b[i] != a[0])
          temp = b[i];
        else if (temp != c[i] and c[i] != a[0])
          temp = c[i];
      }
      cout << temp << " ";
    }
    cout << "\n";
  }
  return 0;
}
