#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, 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 p[n];
    p[0] = a[0];
    for (int j = 1; j < n; j++) {
      if (j == n - 1) {
        if (a[j] != p[n - 2] && a[j] != p[0])
          p[j] = a[j];
        else if (b[j] != p[n - 2] && b[j] != p[0])
          p[j] = b[j];
        else
          p[j] = c[j];
      } else {
        if (a[j] == p[j - 1])
          p[j] = b[j];
        else
          p[j] = a[j];
      }
    }
    for (int j = 0; j < n; j++) cout << p[j] << " ";
    cout << endl;
  }
  return 0;
}
