#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int tc;
  scanf("%lld", &tc);
  while (tc--) {
    long long int n, c, m, i, j, count = 0, x, a, b, y, sum = 0;
    long long int mn = 1e18, mx = 0, ans = 0, k, ind;
    string s;
    cin >> n;
    long long int ara[n + 1], bra[n + 1], cra[n + 1];
    for (i = 1; i <= n; i++) cin >> ara[i];
    for (i = 1; i <= n; i++) cin >> bra[i];
    for (i = 1; i <= n; i++) cin >> cra[i];
    x = min(ara[1], min(bra[1], cra[1]));
    long long int chk = x;
    cout << x << " ";
    for (i = 2; i < n; i++) {
      if (ara[i] != chk) {
        cout << ara[i];
        chk = ara[i];
      } else if (bra[i] != chk) {
        cout << bra[i];
        chk = bra[i];
      } else {
        cout << cra[i];
        chk = cra[i];
      }
      cout << " ";
    }
    if (ara[n] != chk and ara[n] != x)
      mn = ara[n];
    else if (bra[n] != chk and bra[n] != x)
      mn = bra[n];
    else
      mn = cra[n];
    cout << mn << endl;
  }
  return 0;
}
