#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int a[101], b[101], c[101], n;
    cin >> n;
    for (int y = 0; y < n; y++) cin >> a[y];
    for (int y = 0; y < n; y++) cin >> b[y];
    for (int y = 0; y < n; y++) cin >> c[y];
    int q = a[0];
    cout << q << " ";
    for (int y = 1; y < n - 1; y++) {
      if (q == a[y]) {
        cout << b[y] << " ";
        q = b[y];
      } else {
        cout << a[y] << " ";
        q = a[y];
      }
    }
    if (a[n - 1] != q && a[n - 1] != a[0])
      cout << a[n - 1];
    else if (b[n - 1] != q && b[n - 1] != a[0])
      cout << b[n - 1];
    else
      cout << c[n - 1];
    cout << endl;
  }
  return 0;
}
