#include <bits/stdc++.h>
using namespace std;
struct elem {
  int first, second, third;
};
void sort_vector(vector<elem>& arr, int N) {
  for (int i = 0; i < N; ++i) {
    int a, b, c;
    a = b = c = 999999999;
    if (arr[i].first < a) a = arr[i].first;
    if (arr[i].second < a) a = arr[i].second;
    if (arr[i].third < a) a = arr[i].third;
    if (arr[i].first < b && a < arr[i].first) b = arr[i].first;
    if (arr[i].second < b && a < arr[i].second) b = arr[i].second;
    if (arr[i].third < b && a < arr[i].third) b = arr[i].third;
    if (arr[i].first > a && arr[i].first > b) c = arr[i].first;
    if (arr[i].second > a && arr[i].second > b) c = arr[i].second;
    if (arr[i].third > a && arr[i].third > b) c = arr[i].third;
    arr[i].first = a, arr[i].second = b, arr[i].third = c;
  }
}
void testcase() {
  int N;
  cin >> N;
  vector<elem> arr(N);
  for (int i = 0; i < N; ++i) cin >> arr[i].first;
  for (int i = 0; i < N; ++i) cin >> arr[i].second;
  for (int i = 0; i < N; ++i) cin >> arr[i].third;
  sort_vector(arr, N);
  int first_taken_value = -1;
  vector<int> final_p(N);
  for (int i = 0; i < N; ++i) {
    if (first_taken_value == -1) {
      first_taken_value = arr[i].first;
      final_p[i] = arr[i].first;
    } else {
      if (i == N - 1) {
        if (arr[i].first != final_p[i - 1] &&
            arr[i].first != first_taken_value) {
          final_p[i] = arr[i].first;
        } else if (arr[i].second != final_p[i - 1] &&
                   arr[i].second != first_taken_value) {
          final_p[i] = arr[i].second;
        } else
          final_p[i] = arr[i].third;
      } else {
        if (arr[i].first != final_p[i - 1]) {
          final_p[i] = arr[i].first;
        } else if (arr[i].second != final_p[i - 1]) {
          final_p[i] = arr[i].second;
        } else
          final_p[i] = arr[i].third;
      }
    }
  }
  for (int i = 0; i < N; ++i) cout << final_p[i] << " ";
  cout << "\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) testcase();
}
