#include <bits/stdc++.h>
using namespace std;
long long T;
long long n;
long long a[105], b[105], c[105];
int main() {
  scanf("%lld", &T);
  while (T--) {
    long long now = -1;
    long long now2;
    scanf("%lld", &n);
    for (long long i = 1; i <= n; i++) {
      scanf("%lld", &a[i]);
    }
    now2 = a[1];
    for (long long i = 1; i <= n; i++) {
      scanf("%lld", &b[i]);
    }
    for (long long i = 1; i <= n; i++) {
      scanf("%lld", &c[i]);
    }
    for (long long i = 1; i < n; i++) {
      if (now == a[i])
        printf("%lld ", b[i]), now = b[i];
      else
        printf("%lld ", a[i]), now = a[i];
    }
    if (now == a[n] && now2 == b[n] || now2 == a[n] && now == b[n])
      printf("%lld", c[n]);
    else if (now == a[n] || now2 == a[n])
      printf("%lld", b[n]);
    else
      printf("%lld", a[n]);
    puts("");
  }
  return 0;
}
