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