#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n, prev, e, j, i;
  bool trn;
  cin >> t;
  while (t--) {
    cin >> n;
    vector<vector<int>> v(n, vector<int>(3));
    for (j = 0; j < 3; j++) {
      for (i = 0; i < n; i++) cin >> v[i][j];
    }
    prev = v[0][0] - 1;
    for (i = 0; i < n - 1; i++) {
      for (j = 0; j < 3; j++) {
        if (prev != v[i][j]) {
          prev = v[i][j];
          cout << v[i][j] << " ";
          break;
        }
      }
    }
    for (j = 0; j < 3; j++) {
      if (prev != v[i][j] && v[0][0] != v[i][j]) {
        prev = v[i][j];
        cout << v[i][j] << " ";
        break;
      }
    }
    cout << endl;
  }
  return 0;
}
