#include <bits/stdc++.h>
using namespace std;
int n, p[2005], a, b, k;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> p[i];
    a += p[i];
  }
  for (int i = 1 + n; i <= 2 * n; i++) {
    cin >> p[i];
    b += p[i];
  }
  if (a != b) {
    for (int i = 1; i <= 2 * n; i++) cout << p[i] << " ";
    return 0;
  }
  a = b = 0;
  for (int i = 1; i <= n; i++) {
    if (p[i] != p[1]) {
      a = i;
    }
  }
  for (int i = 1 + n; i <= 2 * n; i++) {
    if (p[i] != p[1]) {
      swap(p[i], p[1]);
      b++;
      break;
    } else if (a && p[i] != p[a]) {
      swap(p[i], p[a]);
      b++;
      break;
    }
  }
  if (!a && !b) {
    cout << "-1";
    return 0;
  }
  for (int i = 1; i <= 2 * n; i++) cout << p[i] << " ";
}
