#include <bits/stdc++.h>
using namespace std;
int main() {
  int tc;
  cin >> tc;
  while (tc--) {
    int n;
    cin >> n;
    vector<int> a(n), b(n), c(n), p(n);
    for (int& x : a) scanf("%d", &x);
    for (int& x : b) scanf("%d", &x);
    for (int& x : c) scanf("%d", &x);
    p[0] = a[0];
    for (int i = 1; i < n; i++) {
      if (a[i] != p[i - 1])
        p[i] = a[i];
      else if (b[i] != p[i - 1])
        p[i] = b[i];
      else
        p[i] = c[i];
    }
    vector<int> aux;
    aux.push_back(a[n - 1]);
    aux.push_back(b[n - 1]);
    aux.push_back(c[n - 1]);
    if (p[n - 1] == p[0]) {
      for (int x : aux) {
        if (x != p[n - 1] && x != p[n - 2]) p[n - 1] = x;
      }
    }
    for (int x : p) cout << x << " ";
    cout << "\n";
  }
  return 0;
}
