#include <bits/stdc++.h>
using namespace std;
long long inf = 1000000000000000000, mod = 998244353;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long arr[n], barr[n], carr[n];
    for (long long i = 0; i < n; i++) cin >> arr[i];
    for (long long i = 0; i < n; i++) cin >> barr[i];
    for (long long i = 0; i < n; i++) cin >> carr[i];
    vector<long long> ans;
    for (long long i = 0; i < n - 1; i++) {
      if (ans.empty()) {
        ans.push_back(arr[i]);
        continue;
      }
      if (ans.back() == arr[i]) {
        ans.push_back(barr[i]);
      } else if (ans.back() == barr[i]) {
        ans.push_back(arr[i]);
      } else
        ans.push_back(arr[i]);
    }
    if (arr[n - 1] != ans[0] && arr[n - 1] != ans.back())
      ans.push_back(arr[n - 1]);
    else if (barr[n - 1] != ans[0] && barr[n - 1] != ans.back())
      ans.push_back(barr[n - 1]);
    else if (carr[n - 1] != ans[0] && carr[n - 1] != ans.back())
      ans.push_back(carr[n - 1]);
    for (auto it : ans) cout << it << " ";
    cout << endl;
  }
}
