#include <bits/stdc++.h>
using namespace std;
const long long int N = 105;
long long int a[N], b[N], c[N];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int t, n;
  cin >> t;
  while (t--) {
    cin >> n;
    for (long long int i = 1; i <= n; i++) cin >> a[i];
    for (long long int i = 1; i <= n; i++) cin >> b[i];
    for (long long int i = 1; i <= n; i++) cin >> c[i];
    for (long long int k = 1; k <= 6; k++) {
      vector<long long int> v(n);
      if (k == 1) {
        v[0] = a[1];
        v[n - 1] = b[n];
      } else if (k == 2) {
        v[0] = a[1];
        v[n - 1] = c[n];
      } else if (k == 3) {
        v[0] = b[1];
        v[n - 1] = a[n];
      } else if (k == 4) {
        v[0] = b[1];
        v[n - 1] = c[n];
      } else if (k == 5) {
        v[0] = c[1];
        v[n - 1] = a[n];
      } else if (k == 6) {
        v[0] = c[1];
        v[n - 1] = b[n];
      }
      for (long long int i = 1; i < n; i++) {
        if (a[i + 1] == v[i - 1]) {
          if (b[i + 1] != v[i - 1])
            v[i] = b[i + 1];
          else
            v[i] = c[i + 1];
        } else
          v[i] = a[i + 1];
      }
      if (v[0] != v[n - 1]) {
        for (auto x : v) cout << x << " ";
        cout << endl;
        break;
      }
    }
  }
  return 0;
}
