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