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