#include <bits/stdc++.h>
using namespace std;
long long n, i, j, k, s, res, ans, l;
int fix[1000020], a;
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) scanf("%d", &a), fix[a] = 1, s += a - 1;
  l = 1000000;
  for (i = 1000000; i >= 1; i--) {
    if (fix[i]) continue;
    fix[i] = 2;
    res += 1000000 - i;
    ans++;
    if (res < s) continue;
    while (res > s) {
      if (res - s <= 1000000 && fix[1000000 - res + s] == 2) {
        ans--;
        fix[1000000 - res + s] = 0;
        res = s;
        break;
      }
      while (fix[l] != 2) l--;
      res -= 1000000 - l;
      ans--;
      fix[l] = 0;
    }
    if (res == s) break;
  }
  cout << ans << endl;
  for (i = 1; i <= 1000000; i++)
    if (fix[i] == 2) cout << i << " ";
  cout << endl;
}
