#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e2 + 5;
int a[maxn], b[maxn], c[maxn], ans[maxn];
int n;
int DFS(int pos, int pre) {
  if (pos == n + 1) {
    if (ans[pos - 1] == ans[1]) return 0;
    for (int i = 1; i <= n; ++i) printf("%d ", ans[i]);
    puts("");
    return 1;
  }
  if (a[pos] != pre) {
    ans[pos] = a[pos];
    if (DFS(pos + 1, a[pos])) return 1;
    ans[pos] = 0;
  }
  if (b[pos] != pre) {
    ans[pos] = b[pos];
    if (DFS(pos + 1, b[pos])) return 1;
    ans[pos] = 0;
  }
  if (c[pos] != pre) {
    ans[pos] = c[pos];
    if (DFS(pos + 1, c[pos])) return 1;
    ans[pos] = 0;
  }
  return 0;
}
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    scanf("%d", &n);
    for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
    for (int i = 1; i <= n; ++i) scanf("%d", &b[i]);
    for (int i = 1; i <= n; ++i) scanf("%d", &c[i]);
    DFS(1, 0);
  }
  return 0;
}
