#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  int ar[105];
  int br[105];
  int cr[105];
  int ans[105];
  memset((ans), 0, sizeof(ans));
  for (int i = 0; i < n; i++) cin >> ar[i];
  for (int i = 0; i < n; i++) cin >> br[i];
  for (int i = 0; i < n; i++) cin >> cr[i];
  ar[n] = ar[0];
  br[n] = br[0];
  cr[n] = cr[0];
  ans[0] = ar[0];
  ans[n] = ar[0];
  for (int i = 1; i < n; i++) {
    if (ar[i] != 0 and ans[i - 1] != ar[i] and ans[i + 1] != ar[i]) {
      if (ar[i + 1] == ar[i]) ar[i + 1] = 0;
      if (br[i + 1] == ar[i]) br[i + 1] = 0;
      if (cr[i + 1] == ar[i]) cr[i + 1] = 0;
      ans[i] = ar[i];
    } else if (br[i] != 0 and ans[i - 1] != br[i] and ans[i + 1] != br[i]) {
      if (ar[i + 1] == br[i]) ar[i + 1] = 0;
      if (br[i + 1] == br[i]) br[i + 1] = 0;
      if (cr[i + 1] == br[i]) cr[i + 1] = 0;
      ans[i] = br[i];
    } else if (cr[i] != 0 and ans[i - 1] != cr[i] and ans[i + 1] != cr[i]) {
      if (ar[i + 1] == cr[i]) ar[i + 1] = 0;
      if (br[i + 1] == cr[i]) br[i + 1] = 0;
      if (cr[i + 1] == cr[i]) cr[i + 1] = 0;
      ans[i] = cr[i];
    }
  }
  for (int i = 0; i < n; i++) {
    cout << ans[i];
    if (i == n - 1)
      cout << endl;
    else
      cout << " ";
  }
}
int main() {
  int t;
  cin >> t;
  while (t--) solve();
}
