#include <bits/stdc++.h>
using namespace std;
int a[109], b[109], c[109], p[109];
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    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 pr = -1;
    for (int i = 0; i < n; i++) {
      int x = a[i], y = b[i], z = c[i];
      if (i < n - 1) {
        if (x != pr) {
          p[i] = x;
          pr = x;
        } else if (y != pr) {
          p[i] = y;
          pr = y;
        } else if (z != pr) {
          p[i] = x;
          pr = z;
        }
      } else {
        if (x != pr && x != p[0])
          p[i] = x;
        else if (y != pr && y != p[0])
          p[i] = y;
        else if (z != pr && z != p[0])
          p[i] = z;
      }
    }
    for (int i = 0; i < n; i++) cout << p[i] << " ";
    cout << endl;
  }
}
