#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 7;
int a[10][maxn], t, n;
int main() {
  cin >> t;
  while (t--) {
    cin >> n;
    for (int j = 1; j <= 3; j++)
      for (int i = 0; i < n; i++) cin >> a[j][i];
    vector<int> ans;
    for (int st = 1; st <= 3; st++) {
      if (ans.size() == n) break;
      ans.clear();
      int la = a[st][0];
      ans.push_back(la);
      for (int i = 1; i < n; i++) {
        for (int j = 1; j <= 3; j++) {
          if (i == n - 1 && a[j][i] == a[st][0]) continue;
          if (la == a[j][i]) continue;
          la = a[j][i];
          ans.push_back(la);
          break;
        }
      }
    }
    for (auto i : ans) cout << i << " ";
    cout << endl;
  }
  return 0;
}
