#include <bits/stdc++.h>
using namespace std;
int i, j, k;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    ;
    int a[n];
    int b[n];
    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> v;
    v.push_back(a[0]);
    for (i = 1; i < n - 1; i++) {
      if (a[i] != v[i - 1])
        v.push_back(a[i]);
      else if (a[i] == v[i - 1]) {
        v.push_back(b[i]);
      } else if (b[i] == v[i - 1])
        v.push_back(a[i]);
      else
        v.push_back(c[i]);
    }
    j = n - 1;
    if (a[j] != v[j - 1] and a[j] != v[0])
      v.push_back(a[j]);
    else if (b[j] != v[j - 1] and b[j] != v[0])
      v.push_back(b[j]);
    else
      v.push_back(c[j]);
    for (i = 0; i < n; i++) cout << v[i] << " ";
    cout << '\n';
  }
}
