#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e2 + 2;
int a[3][maxn], p[maxn];
int main(int argc, char *argv[]) {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n;
    scanf("%d", &n);
    for (int i = 0; i < 3; ++i)
      for (int j = 1; j <= n; ++j) scanf("%d", &a[i][j]);
    p[1] = a[0][1];
    for (int i = 2; i < n; ++i)
      for (int j = 0; j < 3; ++j)
        if (a[j][i] != p[i - 1]) {
          p[i] = a[j][i];
          break;
        }
    for (int i = 0; i < 3; ++i)
      if (a[i][n] != p[n - 1] && a[i][n] != p[1]) p[n] = a[i][n];
    for (int i = 1; i <= n; ++i) {
      printf("%d ", p[i]);
    }
    printf("\n");
  }
  return 0;
}
