#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, i, j, k, l, r, x, y, z;
  long long q, t;
  cin >> q;
  while (q--) {
    cin >> n;
    long long a[n + 5], b[n + 5], c[n + 5];
    vector<long long> v;
    k = -1;
    for (i = 0; i < n; i++) {
      cin >> a[i];
    }
    for (i = 0; i < n; i++) {
      cin >> b[i];
    }
    for (i = 0; i < n; i++) {
      cin >> c[i];
    }
    for (i = 0; i < n; i++) {
      if (a[i] != k) {
        v.push_back(a[i]);
        k = a[i];
      } else if (b[i] != k) {
        v.push_back(b[i]);
        k = b[i];
      } else {
        v.push_back(c[i]);
        k = c[i];
      }
    }
    if (v[0] == v[n - 1]) {
      if (a[0] != v[0] && a[0] != v[1]) {
        v[0] = a[0];
        for (i = 0; i < n; i++) cout << v[i] << " ";
        cout << endl;
        continue;
      }
      if (b[0] != v[0] && b[0] != v[1]) {
        v[0] = b[0];
        for (i = 0; i < n; i++) cout << v[i] << " ";
        cout << endl;
        continue;
      }
      if (c[0] != v[0] && c[0] != v[1]) {
        v[0] = c[0];
        for (i = 0; i < n; i++) cout << v[i] << " ";
        cout << endl;
        continue;
      }
      if (a[n - 1] != v[n - 1] && a[n - 1] != v[n - 2]) {
        v[n - 1] = a[n - 1];
        for (i = 0; i < n; i++) cout << v[i] << " ";
        cout << endl;
        continue;
      }
      if (b[n - 1] != v[n - 1] && b[n - 1] != v[n - 2]) {
        v[n - 1] = b[n - 1];
        for (i = 0; i < n; i++) cout << v[i] << " ";
        cout << endl;
        continue;
      }
      if (c[n - 1] != v[n - 1] && c[n - 1] != v[n - 2]) {
        v[n - 1] = c[n - 1];
        for (i = 0; i < n; i++) cout << v[i] << " ";
        cout << endl;
        continue;
      }
    }
    for (i = 0; i < n; i++) cout << v[i] << " ";
    cout << endl;
  }
}
