Bob is an active user of the social network Faithbug. On this network, people are able to engage in a mutual friendship. That is, if a is a friend of b, then b is also a friend of a. Each user thus has a non-negative amount of friends.

This morning, somebody anonymously sent Bob the following link: [graph realization problem](https://en.wikipedia.org/wiki/Graph_realization_problem) and Bob wants to know who that was. In order to do that, he first needs to know how the social network looks like. He investigated the profile of every other person on the network and noted down the number of his friends. However, he neglected to note down the number of his friends. Help him find out how many friends he has. Since there may be many possible answers, print all of them.

Input

The first line contains one integer n (1 ≤ n ≤ 5 ⋅ 10^5), the number of people on the network excluding Bob. 

The second line contains n numbers a_1,a_2, ..., a_n (0 ≤ a_i ≤ n), with a_i being the number of people that person i is a friend of.

Output

Print all possible values of a_{n+1} — the amount of people that Bob can be friend of, in increasing order.

If no solution exists, output -1.

Examples

Input

3
3 3 3


Output

3 


Input

4
1 1 1 1


Output

0 2 4 


Input

2
0 2


Output

-1


Input

35
21 26 18 4 28 2 15 13 16 25 6 32 11 5 31 17 9 3 24 33 14 27 29 1 20 4 12 7 10 30 34 8 19 23 22


Output

13 15 17 19 21 

Note

In the first test case, the only solution is that everyone is friends with everyone. That is why Bob should have 3 friends.

In the second test case, there are three possible solutions (apart from symmetries): 

  * a is friend of b, c is friend of d, and Bob has no friends, or 
  * a is a friend of b and both c and d are friends with Bob, or 
  * Bob is friends of everyone. 



The third case is impossible to solve, as the second person needs to be a friend with everybody, but the first one is a complete stranger.
#include <bits/stdc++.h>
using namespace std;
const long long INF = (long long)1e18;
const int N = 1 << 20;
long long mins[2 * N];
long long tags[2 * N];
void push(int i) {
  if (tags[i] != 0) {
    mins[i] += tags[i];
    if (i < N) {
      tags[2 * i] += tags[i];
      tags[2 * i + 1] += tags[i];
    }
    tags[i] = 0;
  }
}
void add(int a, int b, long long v, int i = 1, int ia = 0, int ib = N - 1) {
  push(i);
  if (b < ia || ib < a) return;
  if (a <= ia && ib <= b) {
    tags[i] += v;
    push(i);
  } else {
    int mid = (ia + ib) >> 1;
    add(a, b, v, 2 * i, ia, mid);
    add(a, b, v, 2 * i + 1, mid + 1, ib);
    mins[i] = min(mins[2 * i], mins[2 * i + 1]);
  }
}
long long get(int a, int b, int i = 1, int ia = 0, int ib = N - 1) {
  push(i);
  if (b < ia || ib < a) return INF;
  if (a <= ia && ib <= b) return mins[i];
  int mid = (ia + ib) >> 1;
  long long res = INF;
  res = min(res, get(a, b, 2 * i, ia, mid));
  res = min(res, get(a, b, 2 * i + 1, mid + 1, ib));
  return res;
}
int bins(const vector<long long>& vals, long long v) {
  int low = 0;
  int high = vals.size();
  while (low != high) {
    int mid = (low + high) >> 1;
    if (vals[mid] <= v)
      high = mid;
    else
      low = mid + 1;
  }
  return low;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  int parity = 0;
  vector<long long> ds(n);
  for (int i = 0; i < n; ++i) {
    cin >> ds[i];
    parity ^= ds[i] % 2;
  }
  for (int i = 0; i < n; ++i) ds[i] *= -1;
  sort(ds.begin(), ds.end());
  for (int i = 0; i < n; ++i) ds[i] *= -1;
  vector<long long> ss(n + 1, 0);
  for (int i = n - 1; i >= 0; --i) ss[i] = ss[i + 1] + ds[i];
  vector<long long> ps(n, 0);
  ps[0] = ds[0];
  for (int i = 1; i < n; ++i) ps[i] = ps[i - 1] + ds[i];
  for (int i = 0; i < n; ++i) {
    int ind = bins(ds, i + 1);
    int inte = max(i + 1, ind);
    long long lst = (long long)(i + 1) * (inte - (i + 1)) + ss[inte];
    long long val = (long long)i * (i + 1) - ps[i] + lst;
    add(i, i, val);
  }
  vector<int> perm;
  for (int i = 0; i < n;) {
    int j = i + 1;
    for (; j < n; ++j) {
      if (ds[j] != ds[i]) break;
    }
    for (int z = j - 1; z >= i; --z) perm.push_back(z);
    i = j;
  }
  vector<int> res;
  if ((get(0, n - 1) >= 0) && (parity == 0)) res.push_back(0);
  for (int j = 0; j < n; ++j) {
    int i = perm[j];
    if (ds[i] == 0) break;
    parity ^= 1;
    add(i, n - 1, 1);
    add(ds[i] - 1, i - 1, -1);
    if ((get(0, n - 1) >= 0) && (parity == 0)) res.push_back(j + 1);
  }
  if (res.empty()) {
    cout << "-1\n";
  } else {
    for (auto it : res) cout << it << ' ';
    cout << '\n';
  }
}
