#include <bits/stdc++.h>
using namespace std;
int main() {
  int TT;
  cin >> TT;
  while (TT--) {
    int n;
    cin >> n;
    vector<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];
    }
    vector<int> p(n, -1);
    for (int i = 0; i < n; ++i) {
      p[i] = a[i];
      if (p[i] == p[(i + 1) % n] || p[i] == p[(i + n - 1) % n]) {
        p[i] = b[i];
        if (p[i] == p[(i + 1) % n] || p[i] == p[(i + n - 1) % n]) {
          p[i] = c[i];
        }
      }
    }
    for (int i = 0; i < n; ++i) {
      cout << p[i] << " ";
    }
    cout << "\n";
  }
  return 0;
}
