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