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