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