#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int a[n], b[n], c[n];
    for (long long int index = 0; index < n; index++) cin >> a[index];
    ;
    for (long long int index = 0; index < n; index++) cin >> b[index];
    ;
    for (long long int index = 0; index < n; index++) cin >> c[index];
    ;
    long long int ans[n], i;
    ans[0] = a[0];
    for (i = 1; i < n - 1; i++) {
      if (a[i] != ans[i - 1])
        ans[i] = a[i];
      else if (b[i] != ans[i - 1])
        ans[i] = b[i];
      else if (c[i] != ans[i - 1])
        ans[i] = c[i];
    }
    if (n >= 3) {
      if (a[n - 1] != ans[n - 2] && a[n - 1] != ans[0])
        ans[n - 1] = a[n - 1];
      else if (b[n - 1] != ans[n - 2] && b[n - 1] != ans[0])
        ans[n - 1] = b[n - 1];
      else if (c[n - 1] != ans[n - 2] && c[n - 1] != ans[0])
        ans[n - 1] = c[n - 1];
    } else if (n == 2) {
      i = 1;
      if (a[i] != ans[i - 1])
        ans[i] = a[i];
      else if (b[i] != ans[i - 1])
        ans[i] = b[i];
      else if (c[i] != ans[i - 1])
        ans[i] = c[i];
    }
    for (long long int index = 0; index < n; index++) cout << ans[index] << " ";
    cout << endl;
    ;
  }
  return 0;
}
