#include "testlib.h"

using namespace std;

int const MAX_N = 100;

void readPermutation(int n) {
  vector<int> a = inf.readInts(n, 1, n, "a");
  inf.readEoln();
  vector<bool> used(n);
  for (int i = 0; i < n; i++) {
    a[i]--;
    ensuref(!used[a[i]], "Duplicate element at index %d", i);
    used[a[i]] = true;
  }
}

int main(int argc, char **argv) {
  registerValidation(argc, argv);
  int n = inf.readInt(1, MAX_N, "n");
  inf.readEoln();
  readPermutation(n);
  readPermutation(n);
  inf.readEof();
  return 0;
}