Little Chris is very keen on his toy blocks. His teacher, however, wants Chris to solve more problems, so he decided to play a trick on Chris.

There are exactly s blocks in Chris's set, each block has a unique number from 1 to s. Chris's teacher picks a subset of blocks X and keeps it to himself. He will give them back only if Chris can pick such a non-empty subset Y from the remaining blocks, that the equality holds: 

<image> "Are you kidding me?", asks Chris.

For example, consider a case where s = 8 and Chris's teacher took the blocks with numbers 1, 4 and 5. One way for Chris to choose a set is to pick the blocks with numbers 3 and 6, see figure. Then the required sums would be equal: (1 - 1) + (4 - 1) + (5 - 1) = (8 - 3) + (8 - 6) = 7.

<image>

However, now Chris has exactly s = 106 blocks. Given the set X of blocks his teacher chooses, help Chris to find the required set Y!

Input

The first line of input contains a single integer n (1 ≤ n ≤ 5·105), the number of blocks in the set X. The next line contains n distinct space-separated integers x1, x2, ..., xn (1 ≤ xi ≤ 106), the numbers of the blocks in X.

Note: since the size of the input and output could be very large, don't use slow output techniques in your language. For example, do not use input and output streams (cin, cout) in C++.

Output

In the first line of output print a single integer m (1 ≤ m ≤ 106 - n), the number of blocks in the set Y. In the next line output m distinct space-separated integers y1, y2, ..., ym (1 ≤ yi ≤ 106), such that the required equality holds. The sets X and Y should not intersect, i.e. xi ≠ yj for all i, j (1 ≤ i ≤ n; 1 ≤ j ≤ m). It is guaranteed that at least one solution always exists. If there are multiple solutions, output any of them.

Examples

Input

3
1 4 5


Output

2
999993 1000000

Input

1
1


Output

1
1000000 
#include <bits/stdc++.h>
using namespace std;
const long double PI = 2 * acos(0.0);
const int stdLength = 25;
const long long max_number = 1048575;
void print(vector<bool> &a) {
  for (bool i : a) {
    cout << i << " ";
  }
  cout << "\n";
}
void print(vector<int> &a) {
  for (int i : a) {
    cout << i << " ";
  }
  cout << "\n";
}
void print(vector<char> &a) {
  for (char i : a) {
    cout << i << " ";
  }
  cout << "\n";
}
void print(vector<long long> &a) {
  for (long long i : a) {
    cout << i << " ";
  }
  cout << "\n";
}
void print(vector<vector<int> > &a) {
  for (vector<int> i : a) {
    print(i);
  }
  cout << "\n";
}
void print(vector<vector<long long> > &a) {
  for (vector<long long> i : a) {
    print(i);
  }
  cout << "\n";
}
void print(vector<double> &a) {
  for (double i : a) {
    cout << i << " ";
  }
  cout << "\n";
}
void print(vector<long double> &a) {
  for (long double i : a) {
    cout << i << " ";
  }
  cout << "\n";
}
void print(vector<pair<long long, long long> > &a) {
  for (pair<long long, long long> i : a) {
    cout << i.first << " " << i.second << "\n";
  }
  cout << "\n";
}
void print(deque<pair<long long, long long> > &a) {
  for (pair<long long, long long> i : a) {
    cout << i.first << " " << i.second << "\n";
  }
  cout << "\n";
}
long long dist_sq(pair<long long, long long> a, pair<long long, long long> b) {
  return ((a.first - b.first) * (a.first - b.first) +
          (a.second - b.second) * (a.second - b.second));
}
long long po(long long a, long long b) {
  if (b <= 0)
    return 1;
  else if (b == 1)
    return a;
  long long vl = po((a * a), b / 2);
  if (b % 2 == 0)
    return vl;
  else
    return (vl)*a;
}
long long pomod(long long a, long long b) {
  a = a % 1000000007LL;
  if (b <= 0)
    return 1 % 1000000007LL;
  else if (b == 1)
    return a % 1000000007LL;
  long long vl = pomod((a * a) % 1000000007LL, b / 2);
  vl = vl % 1000000007LL;
  if (b % 2 == 0)
    return vl;
  else
    return ((vl)*a) % 1000000007LL;
}
long long pomod(long long a, long long b, long long mo) {
  a = a % mo;
  if (b <= 0)
    return 1 % mo;
  else if (b == 1)
    return a % mo;
  long long vl = pomod((a * a) % mo, b / 2);
  vl = vl % mo;
  if (b % 2 == 0)
    return vl;
  else
    return ((vl)*a) % mo;
}
long long factmod(long long n, long long mo) {
  long long val = n;
  long long ans = 1;
  while (val >= 1) {
    ans = (ans * val) % mo;
    val--;
  }
  return ans;
}
long long inv(long long a, long long mo) { return pomod(a, mo - 2, mo); }
long long combinationMod(long long n, long long i) {
  long long ans = 1;
  ans = (ans * factmod(n, 1000000007LL)) % 1000000007LL;
  long long invVal =
      (inv(factmod(i, 1000000007LL), 1000000007LL) % 1000000007LL *
       inv(factmod(n - i, 1000000007LL), 1000000007LL) % 1000000007LL) %
      1000000007LL;
  ans = (ans * invVal) % 1000000007LL;
  return ans;
}
long long greatestCommonDivisor(long long a, long long b) {
  if (b > a) {
    return greatestCommonDivisor(b, a);
  }
  if (b == 0) {
    return a;
  }
  if (a % b == 0) {
    return b;
  } else {
    return greatestCommonDivisor(b, a % b);
  }
}
long long greatestCommonDivisor(const vector<long long> &numList, int st,
                                int en) {
  assert(st >= 0 and st < (int)numList.size());
  assert(en >= 0 and en < (int)numList.size());
  if (st > en) {
    return 0;
  } else if (st == en) {
    return numList[st];
  } else if (en == st + 1) {
    return greatestCommonDivisor(numList[st], numList[st + 1]);
  } else {
    return greatestCommonDivisor(numList[st],
                                 greatestCommonDivisor(numList, st + 1, en));
  }
}
long long greatestCommonDivisor(const vector<long long> &numList) {
  if (numList.size() == 0) {
    return 0;
  }
  int st = 0;
  int en = numList.size();
  en--;
  return greatestCommonDivisor(numList, st, en);
}
vector<vector<long long> > preComputeCombinationMod(int n) {
  vector<vector<long long> > comb(n + 1, vector<long long>(n + 1, 0));
  comb[0][0] = 1;
  for (long long i = (1); i <= (n); i++) {
    comb[i][0] = 1;
    comb[0][i] = 0;
  }
  for (long long i = (1); i <= (n); i++) {
    for (long long j = (1); j <= (i); j++) {
      comb[i][j] =
          (comb[i - 1][j - 1] % 1000000007LL + comb[i - 1][j] % 1000000007LL) %
          1000000007LL;
    }
  }
  return comb;
}
long long floorlog2(long long n) {
  long long h = 0;
  long long p = 1;
  while (p <= n) {
    h++;
    p *= 2;
  }
  return h - 1;
}
long long floorlog2(long long n, long long b) {
  long long h = 0;
  long long p = 1;
  while (p <= n) {
    h++;
    p *= b;
  }
  return h - 1;
}
class Trie {
 private:
  vector<Trie *> children;
  bool this_inserted = false;

 public:
  Trie() {
    children.resize(26, NULL);
    this_inserted = false;
  }
  void insert(string word) {
    Trie *cur = this;
    for (char c : word) {
      int ind = c - 'a';
      if (cur->children[ind] == NULL) {
        cur->children[ind] = new Trie();
      }
      cur = cur->children[ind];
    }
    cur->this_inserted = true;
  }
  bool search(string word) {
    Trie *cur = this;
    for (char c : word) {
      int ind = c - 'a';
      if (cur->children[ind] == NULL) {
        return false;
      }
      cur = cur->children[ind];
    }
    return cur->this_inserted;
  }
  bool startsWith(string prefix) {
    string word = prefix;
    Trie *cur = this;
    for (char c : word) {
      int ind = c - 'a';
      if (cur->children[ind] == NULL) {
        return false;
      }
      cur = cur->children[ind];
    }
    return true;
  }
};
class FenwickTree {
 public:
  vector<long long> BIT;
  FenwickTree(int n) { BIT.resize(n + 1, 0); }
  FenwickTree(vector<long long> a) {
    int n = a.size();
    BIT.resize(n + 1, 0);
    for (long long i = (0); i <= (n - 1); i++) {
      update(i + 1, a[i]);
    }
  }
  FenwickTree(vector<int> a) {
    vector<long long> b(a.begin(), a.end());
    int n = b.size();
    BIT.resize(n + 1, 0);
    for (long long i = (0); i <= (n - 1); i++) {
      update(i + 1, b[i]);
    }
  }
  void update(int ind, long long val) {
    assert(0 <= ind and ind < BIT.size());
    int first = ind;
    int sz = BIT.size();
    while (first < sz) {
      BIT[first] += val;
      first += (first & -first);
    }
  }
  void set(int ind, long long val) {
    assert(0 <= ind and ind < BIT.size());
    long long currentVal = query(ind, ind);
    update(ind, val - currentVal);
  }
  long long query(int l, int r) {
    assert(0 <= l and r < BIT.size());
    if (r < l) {
      return 0;
    } else
      return prefQuery(r) - prefQuery(l - 1);
  }
  long long prefQuery(int ind) {
    assert(0 <= ind and ind < BIT.size());
    int first = ind;
    long long sum = 0;
    while (first > 0) {
      sum += BIT[first];
      first -= (first & -first);
    }
    return sum;
  }
};
vector<long long> getPrimes(long long highestNum) {
  vector<bool> isPrime(highestNum + 5, true);
  vector<long long> primes;
  for (long long i = (2); i <= (highestNum); i++) {
    if (isPrime[i]) {
      primes.push_back(i);
      long long j = i;
      while (j * i <= highestNum) {
        isPrime[j * i] = false;
        j++;
      }
    }
  }
  return primes;
}
long long getMultiplicity(long long num, long long prime) {
  long long mult = 0;
  while (num % prime == 0) {
    mult += 1;
    num /= prime;
  }
  return mult;
}
vector<long long> getPrimeFactorization(long long num,
                                        vector<long long> &primes) {
  int sz = primes.size();
  vector<long long> multcities(sz, 0);
  for (long long i = (0); i <= (sz - 1); i++) {
    long long prime = primes[i];
    if (prime > num)
      return multcities;
    else {
      multcities[i] = getMultiplicity(num, prime);
      long long di = po(prime, multcities[i]);
      num = num / di;
    }
  }
  return multcities;
}
map<long long, long long> getMapPrimeFactorization(long long num,
                                                   vector<long long> &primes) {
  int sz = primes.size();
  map<long long, long long> primeFac;
  for (long long i = (0); i <= (sz - 1); i++) {
    long long prime = primes[i];
    if (prime > num)
      return primeFac;
    else {
      primeFac[prime] = getMultiplicity(num, prime);
      long long di = po(prime, primeFac[prime]);
      num = num / di;
    }
  }
  return primeFac;
}
vector<pair<long long, long long> > getListPrimeFactorization(
    long long num, vector<long long> &primes) {
  int sz = primes.size();
  vector<pair<long long, long long> > primeFac;
  for (long long i = (0); i <= (sz - 1); i++) {
    long long prime = primes[i];
    if (prime > num)
      return primeFac;
    else {
      long long mult = getMultiplicity(num, prime);
      long long di = po(prime, mult);
      num = num / di;
      if (mult > 0) {
        primeFac.push_back(make_pair(prime, mult));
      }
    }
  }
  return primeFac;
}
vector<int> compute_z(string second) {
  int n = second.length();
  vector<int> z(n, 0);
  int l = 0, r = 0;
  z[0] = n;
  for (long long i = (1); i <= (n - 1); i++) {
    if (r < i) {
      l = r = i;
      int j = 0;
      if (second[0] != second[i]) {
        continue;
      }
      while (j < n and second[j] == second[i + j]) {
        j++;
      }
      r = i + j - 1;
      z[i] = r - i + 1;
    } else {
      int beta = r - i + 1;
      int k = i - l;
      if (z[k] < beta) {
        z[i] = z[k];
      } else {
        int j = 0;
        l = i;
        while (r < n and second[r] == second[r - l]) {
          r += 1;
        }
        r -= 1;
        z[i] = r - i + 1;
      }
    }
  }
  return z;
}
vector<int> getOccurences(string second, string t) {
  string comb = t + "$" + second;
  auto z_vals = compute_z(comb);
  int n = second.size();
  int t_sz = t.size();
  vector<int> occ;
  for (long long i = (0); i <= (n - 1); i++) {
    if (z_vals[t_sz + 1 + i] == t_sz) {
      occ.push_back(i);
    }
  }
  return occ;
}
class DSU {
 private:
  vector<int> parent;
  vector<int> size;

 public:
  DSU(int n) {
    parent.resize(n + 5, 0);
    size.resize(n + 5, 0);
    for (long long i = (1); i <= (n); i++) {
      parent[i] = i;
      size[i] = 1;
    }
  }
  vector<int> getParents() { return parent; }
  vector<int> getSizes() { return size; }
  int getRoot(int node) {
    int par = parent[node];
    if (parent[par] == par) {
      return par;
    }
    int root = getRoot(par);
    parent[node] = root;
    return root;
  }
  bool checkSame(int a, int b) { return getRoot(a) == getRoot(b); }
  void connectNodes(int a, int b) {
    int root1 = getRoot(a);
    int root2 = getRoot(b);
    if (size[root1] < size[root2]) {
      swap(root1, root2);
    }
    parent[root2] = root1;
    size[root1] += size[root2];
  }
};
class SegmentTreeNode {
 private:
  long long total;
  long long pendingUpdate;

 public:
  int start, end;
  SegmentTreeNode() : total(0), start(-1), end(-1), pendingUpdate(0) {}
  void assignLeaf(long long value, int start, int end) {
    total = value;
    this->start = start;
    this->end = end;
  }
  void merge(SegmentTreeNode &left, SegmentTreeNode &right) {
    this->start = left.start;
    this->end = right.end;
    long long leftTotal = left.getValue();
    long long rightTotal = right.getValue();
    if (left.ifPendingUpdate()) {
      leftTotal += left.getSegmentSize() * left.getPendingUpdate();
    }
    if (right.ifPendingUpdate()) {
      rightTotal += right.getSegmentSize() * right.getPendingUpdate();
    }
    this->total = leftTotal + rightTotal;
  }
  long long getValue() { return total; }
  long long getPendingUpdate() { return pendingUpdate; }
  bool ifPendingUpdate() { return pendingUpdate != 0; }
  void applyPendingUpdate() {
    this->total += (this->pendingUpdate) * (this->getSegmentSize());
    this->pendingUpdate = 0;
  }
  void addUpdate(long long val) { this->pendingUpdate += val; }
  int getSegmentSize() { return (end - start + 1); }
};
class SegmentTree {
 public:
  int N;
  SegmentTree(vector<long long> &arr) {
    this->N = arr.size();
    this->treeSize = getSegmentTreeSize(this->N);
    nodes.resize(this->treeSize);
    this->buildTree(arr, 1, 0, N - 1);
  }
  void updateRange(int startPos, int endPos, long long val) {
    updateRange(1, startPos, endPos, val);
  }
  long long getValue(int startPos, int endPos) {
    auto res = getValue(1, startPos, endPos);
    return res.getValue();
  }

 private:
  vector<SegmentTreeNode> nodes;
  int treeSize;
  void buildTree(vector<long long> &arr, int stIndex, int left, int right) {
    if (left == right) {
      this->nodes[stIndex].assignLeaf(arr[left], left, right);
      return;
    }
    int mid = (left + right) / 2;
    int leftIndex = 2 * stIndex, rightIndex = leftIndex + 1;
    buildTree(arr, leftIndex, left, mid);
    buildTree(arr, rightIndex, mid + 1, right);
    nodes[stIndex].merge(nodes[leftIndex], nodes[rightIndex]);
  }
  void updateRange(int stIndex, int startPos, int endPos, long long val) {
    if (startPos == nodes[stIndex].start and endPos == nodes[stIndex].end) {
      nodes[stIndex].addUpdate(val);
      return;
    }
    int mid = (nodes[stIndex].start + nodes[stIndex].end) / 2;
    int leftChildIndex = 2 * stIndex, rightChildIndex = leftChildIndex + 1;
    if (endPos <= mid) {
      updateRange(leftChildIndex, startPos, endPos, val);
    } else if (startPos > mid) {
      updateRange(rightChildIndex, startPos, endPos, val);
    } else {
      updateRange(leftChildIndex, startPos, mid, val);
      updateRange(rightChildIndex, mid + 1, endPos, val);
    }
    nodes[stIndex].merge(nodes[leftChildIndex], nodes[rightChildIndex]);
  }
  SegmentTreeNode getValue(int stIndex, int startPos, int endPos) {
    if (startPos == nodes[stIndex].start and endPos == nodes[stIndex].end) {
      auto result = nodes[stIndex];
      if (result.ifPendingUpdate()) result.applyPendingUpdate();
      return result;
    }
    int mid = (nodes[stIndex].start + nodes[stIndex].end) / 2;
    int leftChildIndex = 2 * stIndex, rightChildIndex = leftChildIndex + 1;
    SegmentTreeNode result;
    if (endPos <= mid) {
      result = getValue(leftChildIndex, startPos, endPos);
    } else if (startPos > mid) {
      result = getValue(rightChildIndex, startPos, endPos);
    } else {
      auto leftResult = getValue(leftChildIndex, startPos, mid);
      auto rightResult = getValue(rightChildIndex, mid + 1, endPos);
      result.merge(leftResult, rightResult);
    }
    if (nodes[stIndex].ifPendingUpdate()) {
      result.addUpdate(nodes[stIndex].getPendingUpdate());
      result.applyPendingUpdate();
    }
    return result;
  }
  int getSegmentTreeSize(int N) {
    int first = 1;
    while (first < N) {
      first = first * 2;
    }
    return first * 2;
  }
};
vector<pair<int, int> > jiro(100 + 5);
vector<int> ciel(100 + 5);
vector<int> ciel_pref(100 + 5);
int n, m;
map<pair<vector<pair<int, int> >, vector<int> >, int> dpAns;
int calcTotal(int end_jiro, int end_ciel) {
  if (end_jiro < 0 or end_jiro > n) {
    return 0;
  }
  if (end_ciel < 0 or end_ciel > m) {
    return 0;
  }
  if (end_ciel == 0) {
    return 0;
  }
  if (end_jiro == 0) {
    int ans = 0;
    for (long long j = (1); j <= (end_ciel); j++) {
      if (ciel[j] > 0) {
        ans += ciel[j];
      }
    }
    return ans;
  }
  auto seenBefore = make_pair(jiro, ciel);
  if (dpAns.count(seenBefore)) {
    return dpAns[seenBefore];
  }
  bool isJiroEmpty = true;
  for (long long jiro_ind = (1); jiro_ind <= (end_jiro); jiro_ind++) {
    if (jiro[jiro_ind].first <= 8000) {
      isJiroEmpty = false;
      break;
    }
  }
  if (isJiroEmpty) {
    int ciel_sum = 0;
    for (long long ciel_ind = (1); ciel_ind <= (end_ciel); ciel_ind++) {
      if (ciel[ciel_ind] > 0) {
        ciel_sum += ciel[ciel_ind];
      }
    }
    dpAns[seenBefore] = ciel_sum;
    return ciel_sum;
  }
  int max_ans = 0;
  for (long long ciel_ind = (1); ciel_ind <= (end_ciel); ciel_ind++) {
    for (long long jiro_ind = (1); jiro_ind <= (end_jiro); jiro_ind++) {
      bool firstCheck =
          jiro[jiro_ind].second and ciel[ciel_ind] >= jiro[jiro_ind].first;
      bool secondCheck =
          jiro[jiro_ind].second == 0 and ciel[ciel_ind] > jiro[jiro_ind].first;
      int damage = 0;
      if (!(firstCheck or secondCheck)) {
        continue;
      }
      if (firstCheck) {
        damage = ciel[ciel_ind] - jiro[jiro_ind].first;
      }
      int temp_ciel = ciel[ciel_ind];
      int temp_jiro = jiro[jiro_ind].first;
      ciel[ciel_ind] = -1;
      jiro[jiro_ind].first = 8001;
      int rest_damage = calcTotal(end_jiro, end_ciel);
      ciel[ciel_ind] = temp_ciel;
      jiro[jiro_ind].first = temp_jiro;
      max_ans = max(max_ans, damage + rest_damage);
    }
  }
  dpAns[seenBefore] = max_ans;
  return max_ans;
}
const int DEBUG = 0;
int computeAnsJiroDefeated(vector<int> &ciel, vector<int> &jiro_att,
                           vector<int> &jiro_def) {
  vector<bool> cielUsed(ciel.size(), false);
  int ciel_sz = ciel.size();
  for (auto jiro_def_card : jiro_def) {
    bool found_card = false;
    for (long long j = (0); j <= (ciel_sz - 1); j++) {
      if (ciel[j] > jiro_def_card and !cielUsed[j]) {
        cielUsed[j] = 1;
        found_card = true;
        break;
      }
    }
    if (!found_card) return 0;
  }
  int ans = 0;
  int jiro_sz = jiro_att.size();
  for (long long jiro_ind = (jiro_sz - 1); jiro_ind >= (0); jiro_ind--) {
    auto jiro_att_card = jiro_att[jiro_ind];
    bool found_card = false;
    for (long long j = (ciel_sz - 1); j >= (0); j--) {
      if (ciel[j] >= jiro_att_card and !cielUsed[j]) {
        cielUsed[j] = 1;
        found_card = true;
        ans += ciel[j] - jiro_att_card;
        break;
      }
    }
    if (!found_card) return 0;
  }
  for (long long j = (0); j <= (ciel_sz - 1); j++) {
    if (!cielUsed[j]) {
      ans += ciel[j];
    }
  }
  return ans;
}
int kPossible(vector<int> &ciel, vector<int> &jiro_att, int k) {
  int ciel_sz = ciel.size();
  int jiro_sz = jiro_att.size();
  if (k > jiro_sz or k > ciel_sz) return 0;
  int ans = 0;
  for (long long jiro_ind = (0); jiro_ind <= (k - 1); jiro_ind++) {
    int ciel_ind = ciel_sz - k + jiro_ind;
    if (ciel[ciel_ind] >= jiro_att[jiro_ind]) {
      ans += ciel[ciel_ind] - jiro_att[jiro_ind];
    } else {
      return 0;
    }
  }
  return ans;
}
int computeAnsJiroUndefeated(vector<int> &ciel, vector<int> &jiro_att,
                             vector<int> &jiro_def) {
  int ciel_sz = ciel.size();
  int jiro_sz = jiro_att.size();
  int maxk = min(jiro_sz, ciel_sz);
  int ans = 0;
  for (long long k = (maxk); k >= (1); k--) {
    int kthAns = kPossible(ciel, jiro_att, k);
    if (DEBUG) {
      cout << "k, kthAns: " << k << " " << kthAns << "\n";
    }
    ans = max(kthAns, ans);
  }
  return ans;
}
int computeAns(vector<int> &ciel, vector<int> &jiro_att,
               vector<int> &jiro_def) {
  int ansJiroDefeated = computeAnsJiroDefeated(ciel, jiro_att, jiro_def);
  int ansJiroUndefeated = computeAnsJiroUndefeated(ciel, jiro_att, jiro_def);
  if (DEBUG) {
    cout << "ansJiroDefeated: " << ansJiroDefeated << "\n";
    cout << "ansJiroUndefeated: " << ansJiroUndefeated << "\n";
  }
  return max(ansJiroDefeated, ansJiroUndefeated);
}
int second = 1000000LL;
map<pair<int, long long>, bool> dp;
vector<int> ans;
bool compute(int start, long long sum, vector<bool> &all, vector<int> &vals) {
  long long sumval = second - start;
  auto seenVal = make_pair(start, sum);
  if (dp.count(seenVal)) {
    return dp[seenVal];
  }
  if (sum < 0) {
    dp[seenVal] = false;
    return false;
  }
  if (sumval == sum and all[start]) {
    dp[seenVal] = true;
    vals.push_back(start);
    return true;
  }
  if (sum == 0) {
    dp[seenVal] = true;
    return true;
  }
  if (start > second) {
    dp[seenVal] = false;
    return false;
  }
  bool primaryVal = all[start] and compute(start + 1, sum - sumval, all, vals);
  if (primaryVal) {
    dp[seenVal] = true;
    vals.push_back(start);
    return true;
  }
  bool secondaryVal = compute(start + 1, sum, all, vals);
  if (secondaryVal) {
    dp[seenVal] = true;
    return true;
  }
  dp[seenVal] = false;
  return false;
}
vector<int> constructSolution(int start, int sum, vector<bool> &all) {
  vector<int> ans;
  while (start < second) {
    int sumval = second - start;
    if (all[start] and dp[make_pair(start + 1, sum - sumval)]) {
      ans.push_back(start);
      sum -= sumval;
    }
    start = start + 1;
  }
  return ans;
}
int main(void) {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<bool> all(1000000LL + 1, true);
  vector<int> X;
  long long sum = 0;
  for (long long i = (1); i <= (n); i++) {
    int first;
    cin >> first;
    sum += ((long long)first - 1);
    all[first] = false;
    X.push_back(first);
  }
  vector<int> vals;
  for (auto first : X) {
    if (all[second - (first - 1)]) {
      sum -= (first - 1);
      all[second - (first - 1)] = false;
      vals.push_back(second - (first - 1));
    }
  }
  int md = sum % (second - 1);
  int mult = sum / (second - 1);
  assert(md == 0);
  for (long long first = (1); first <= (second); first++) {
    if (sum == 0) break;
    if (all[first] and all[second - (first - 1)]) {
      all[first] = false;
      all[second - (first - 1)] = false;
      sum -= (second - 1);
      vals.push_back(first);
      vals.push_back(second - (first - 1));
    }
  }
  printf("%d\n", vals.size());
  for (auto vl : vals) {
    printf("%d ", vl);
  }
  return 0;
}
