#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n{};
  cin >> n;
  vector<long long int> a(n);
  vector<long long int> b(n);
  vector<long long int> c(n);
  vector<long long int> p(n);
  for (long long int i = 0; i < n; i++) {
    cin >> a.at(i);
  }
  for (long long int i = 0; i < n; i++) {
    cin >> b.at(i);
  }
  for (long long int i = 0; i < n; i++) {
    cin >> c.at(i);
  }
  p.at(0) = a.at(0);
  for (long long int i = 1; i < n - 1; i++) {
    if (a.at(i) != p.at(i - 1)) {
      p.at(i) = a.at(i);
    } else if (b.at(i) != p.at(i - 1)) {
      p.at(i) = b.at(i);
    } else if (c.at(i) != p.at(i - 1)) {
      p.at(i) = c.at(i);
    }
  }
  if (a.at(n - 1) != p.at(n - 2) && a.at(n - 1) != p.at(0)) {
    p.at(n - 1) = a.at(n - 1);
  } else if (b.at(n - 1) != p.at(n - 2) && b.at(n - 1) != p.at(0)) {
    p.at(n - 1) = b.at(n - 1);
  } else if (c.at(n - 1) != p.at(n - 2) && c.at(n - 1) != p.at(0)) {
    p.at(n - 1) = c.at(n - 1);
  }
  for (long long int i = 0; i < n; i++) {
    cout << p.at(i) << " ";
  }
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t{};
  cin >> t;
  while (t--) solve();
  return 0;
}
