#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    vector<long long> a(n), b(n), c(n);
    for (long long i = 0; i < n; i++) cin >> a[i];
    for (long long i = 0; i < n; i++) cin >> b[i];
    for (long long i = 0; i < n; i++) cin >> c[i];
    vector<long long> ans;
    ans.push_back(a[0]);
    for (long long i = 1; i < n - 1; i++) {
      if (a[i] != ans.back())
        ans.push_back(a[i]);
      else if (b[i] != ans.back())
        ans.push_back(b[i]);
      else if (c[i] != ans.back())
        ans.push_back(c[i]);
    }
    if (a[n - 1] != ans.back() and a[n - 1] != ans[0])
      ans.push_back(a[n - 1]);
    else if (b[n - 1] != ans.back() and b[n - 1] != ans[0])
      ans.push_back(b[n - 1]);
    else if (c[n - 1] != ans.back() and c[n - 1] != ans[0])
      ans.push_back(c[n - 1]);
    for (auto e : ans) cout << e << " ";
    cout << endl;
  }
  return 0;
}
