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;
int n;
vector<int> deg;
const long long inf = 1LL << 31;
long long seg[500010 * 4];
long long seg2[500010 * 4];
long long ovals[500010];
const bool debug = false;
void buildtree(int ss = 1, int se = n, int si = 0) {
  if (ss == se) {
    if (debug) {
      cout << "oval for " << ss << " is " << ovals[ss] << endl;
    }
    seg[si] = ovals[ss];
    seg2[si] = ovals[ss] + ss;
    return;
  }
  int mid = (ss + se) / 2;
  buildtree(ss, mid, si * 2 + 1);
  buildtree(mid + 1, se, si * 2 + 2);
  seg[si] = min(seg[si * 2 + 1], seg[si * 2 + 2]);
  seg2[si] = min(seg2[si * 2 + 1], seg2[si * 2 + 2]);
}
long long query(int qs, int qe, int ss = 1, int se = n, int si = 0) {
  if (qs > qe || ss > se || qs > se || qe < ss) return inf;
  if (qs <= ss && se <= qe) return seg[si];
  int mid = (ss + se) / 2;
  return min(query(qs, qe, ss, mid, si * 2 + 1),
             query(qs, qe, mid + 1, se, si * 2 + 2));
}
long long query2(int qs, int qe, int ss = 1, int se = n, int si = 0) {
  if (qs > qe || ss > se || qs > se || qe < ss) return inf;
  if (qs <= ss && se <= qe) return seg2[si];
  int mid = (ss + se) / 2;
  return min(query2(qs, qe, ss, mid, si * 2 + 1),
             query2(qs, qe, mid + 1, se, si * 2 + 2));
}
void update(int spot, long long val, int ss = 1, int se = n, int si = 0) {
  if (ss > se || spot > se || spot < ss) return;
  if (ss == se) {
    seg[si] = val;
    seg2[si] = val + spot;
    return;
  }
  int mid = (ss + se) / 2;
  if (spot <= mid) {
    update(spot, val, ss, mid, si * 2 + 1);
  } else
    update(spot, val, mid + 1, se, si * 2 + 2);
  seg[si] = min(seg[si * 2 + 1], seg[si * 2 + 2]);
  seg2[si] = min(seg2[si * 2 + 1], seg2[si * 2 + 2]);
}
long long sumbef[500010];
long long incval[500010];
vector<int> ans;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  int cur;
  long long sum = 0LL;
  for (int i = 0; i < n; i++) {
    cin >> cur;
    deg.push_back(cur);
    sum += cur;
  }
  deg.push_back(500010);
  sort(deg.begin(), deg.end());
  reverse(deg.begin(), deg.end());
  sumbef[1] = 0LL;
  for (int i = 2; i <= n + 1; i++) {
    sumbef[i] = sumbef[i - 1] + deg[i - 1];
  }
  for (int i = 1; i <= n; i++) {
    ovals[i] = i * 1LL * (i - 1);
  }
  long long sub = 0LL;
  for (int i = 1; i <= n; i++) {
    sub += deg[i];
    ovals[i] -= sub;
  }
  long long inc = 0LL;
  int numk = 0;
  priority_queue<int> pq;
  for (int i = n; i >= 1; i--) {
    inc -= numk;
    while (pq.size() && pq.top() > i) {
      numk++;
      inc += i - pq.top();
      pq.pop();
    }
    ovals[i] += inc;
    incval[i] = numk;
    pq.push(deg[i]);
    inc += deg[i];
  }
  buildtree();
  inc = 0LL;
  numk = 0;
  while (pq.size()) pq.pop();
  int spot = n + 1;
  for (int val = 0; val <= n; val++) {
    int nspot = spot;
    while (nspot > 0 && deg[nspot - 1] < val) nspot--;
    for (int i = spot - 1; i >= nspot; i--) {
      long long nv = ovals[i];
      nv -= i * 1LL * (i - 1LL);
      nv += i * 1LL * (i + 1LL);
      nv += incval[i] + 0LL;
      update(i, nv);
      if (debug)
        cout << "new val for " << i << "(" << deg[i] << ")"
             << " :: " << nv << endl;
      pq.push(deg[i]);
      inc += deg[i];
    }
    inc -= numk * 1LL * (spot - nspot);
    while (pq.size() && pq.top() >= nspot) {
      numk++;
      inc += nspot - pq.top();
      pq.pop();
    }
    bool ok = true;
    if ((sum + val) % 2 != 0) {
      ok = false;
    } else {
      long long minaft = query(nspot, n);
      if (debug) cout << val << " min aft:  " << minaft << endl;
      minaft -= val;
      if (minaft < 0) ok = false;
      if (debug && val == 21)
        cout << "MA: " << minaft << endl;
      else {
        long long mv = query(val, nspot - 1);
        mv += val;
        if (mv < 0) ok = false;
        mv = query2(1, min(val, nspot - 1));
        if (mv < 0) ok = false;
      }
    }
    if (ok) {
      long long cv = nspot * 1LL * (nspot - 1LL);
      cv -= sumbef[nspot];
      cv -= val;
      cv += inc;
      if (debug) cout << val << "  cv:  " << cv << endl;
      if (cv < 0) ok = false;
    }
    if (debug) cout << val << " : " << spot << endl;
    if (ok) ans.push_back(val);
    spot = nspot;
  }
  if (ans.size()) {
    for (int v : ans) cout << v << " ";
    cout << endl;
  } else
    cout << -1 << endl;
}
