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