#include <bits/stdc++.h>
using namespace std;
int t, n, dt[200][3], res[200];
int main() {
  cin >> t;
  while (t--) {
    cin >> n;
    for (int i = 0; i < 3; i++)
      for (int j = 0; j < n; j++) cin >> dt[j][i];
    for (int i = 0; i < n; i++)
      for (int j = 0; j < 3; j++)
        if (dt[i][j] != res[(i + n - 1) % n] && dt[i][j] != res[(i + 1) % n])
          res[i] = dt[i][j];
    for (int i = 0; i < n; i++) cout << res[i] << " ";
    cout << endl;
  }
}
