#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using pii = pair<int, int>;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a[n], b[n], c[n], res[n];
    for (int i = 0; i < n; i++) cin >> a[i];
    for (int i = 0; i < n; i++) cin >> b[i];
    for (int i = 0; i < n; i++) cin >> c[i];
    res[0] = a[0];
    for (int i = 1; i < n - 1; i++) {
      if (a[i] == res[i - 1])
        res[i] = b[i];
      else
        res[i] = a[i];
    }
    if (a[n - 1] != res[0] && a[n - 1] != res[n - 2])
      res[n - 1] = a[n - 1];
    else if (b[n - 1] != res[0] && b[n - 1] != res[n - 2])
      res[n - 1] = b[n - 1];
    else
      res[n - 1] = c[n - 1];
    for (int i = 0; i < n; i++) cout << res[i] << " \n"[i == n - 1];
  }
}
