#include <bits/stdc++.h>
using namespace std;
int *readIntArray(long long size) {
  int *nums = new int[size];
  for (long long i = 0; i < size; i++) {
    cin >> nums[i];
  }
  return nums;
}
long long *readllArray(long long size) {
  long long *nums = new long long[size];
  for (long long i = 0; i < size; i++) {
    cin >> nums[i];
  }
  return nums;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int size;
    cin >> size;
    int *a1 = readIntArray(size);
    int *a2 = readIntArray(size);
    int *a3 = readIntArray(size);
    bool activeArray = true;
    cout << a1[0] << " ";
    int prev = a1[0];
    int i = 1;
    while (i < size - 1) {
      if (activeArray) {
        if (a1[i] == prev) {
          activeArray = !activeArray;
        } else {
          prev = a1[i];
          cout << a1[i] << " ";
          i++;
          continue;
        }
      }
      if (!activeArray) {
        if (a2[i] == prev) {
          activeArray = !activeArray;
        } else {
          prev = a2[i];
          cout << a2[i] << " ";
          i++;
          continue;
        }
      }
    }
    int last =
        (a2[size - 1] != prev && a2[size - 1] != a1[0])
            ? a2[size - 1]
            : ((a3[size - 1] != prev && a3[size - 1] != a1[0]) ? a3[size - 1]
                                                               : a1[size - 1]);
    cout << last << "\n";
  }
}
