#include <bits/stdc++.h>
int main() {
  long long a, b, c, d, e, f, g, h, i, j, k, l;
  scanf("%lli", &a);
  for (; a; a--) {
    scanf("%lli", &b);
    long long x[b], y[b], z[b];
    for (c = 0; c < b; c++) scanf("%lli", &x[c]);
    for (c = 0; c < b; c++) scanf("%lli", &y[c]);
    for (c = 0; c < b; c++) scanf("%lli", &z[c]);
    for (c = d = e = 0; c < b - 1; c++) {
      if (x[c] != d) {
        d = x[c];
      } else if (y[c] != d)
        d = y[c];
      else
        d = z[c];
      printf("%lli ", d);
      if (c == 0) e = d;
    }
    if (x[c] != d && x[c] != e)
      printf("%lli\n", x[c]);
    else if (y[c] != d && y[c] != e)
      printf("%lli\n", y[c]);
    else if (z[c] != d && z[c] != e)
      printf("%lli\n", z[c]);
  }
  return 0;
}
