#include <bits/stdc++.h>
template <typename TYPE>
inline void read(TYPE &x) {
  x = 0;
  int w = 0;
  char c = getchar();
  for (; c < '0' || c > '9'; c = getchar())
    if (c == '-') w = ~w;
  for (; c >= '0' && c <= '9'; c = getchar())
    x = (x << 3) + (x << 1) + (c ^ 48);
  x = !w ? x : -x;
}
int n, a[105], b[105], c[105];
int main(void) {
  int t;
  for (read(t); t--;) {
    read(n);
    for (int i = 1; i <= n; ++i) read(a[i]);
    for (int i = 1; i <= n; ++i) read(b[i]);
    for (int i = 1; i <= n; ++i) read(c[i]);
    printf("%d ", a[1]);
    int last = a[1];
    for (int i = 2; i < n; ++i)
      if (a[i] != last) {
        printf("%d ", a[i]);
        last = a[i];
      } else if (b[i] != last) {
        printf("%d ", b[i]);
        last = b[i];
      } else if (c[i] != last) {
        printf("%d ", c[i]);
        last = c[i];
      }
    if (a[n] != last && a[n] != a[1])
      printf("%d\n", a[n]);
    else if (b[n] != last && b[n] != a[1])
      printf("%d\n", b[n]);
    else if (c[n] != last && c[n] != a[1])
      printf("%d\n", c[n]);
  }
  return 0;
}
