#include <bits/stdc++.h>
using namespace std;
long long int n;
bool f[1000005], t[1000005];
vector<long long int> x, y;
int main() {
  long long int num, a, s, b, sz;
  s = 1000000;
  cin >> n;
  a = n;
  while (a--) {
    scanf("%I64d", &num);
    f[num] = 1;
    x.push_back(num);
  }
  b = 1;
  for (a = 0; a < n; a++) {
    if (t[x[a]] == 1) continue;
    if (f[s + 1 - x[a]] == 0) {
      y.push_back(s + 1 - x[a]);
    } else {
      t[s + 1 - x[a]] = 1;
      for (; b <= s; b++) {
        if (f[b] == 0 && f[s + 1 - b] == 0) {
          y.push_back(b);
          y.push_back(s + 1 - b);
          b++;
          break;
        }
      }
    }
  }
  sz = y.size();
  cout << sz << '\n';
  cout << y[0];
  for (a = 1; a < sz; a++) printf(" %I64d", y[a]);
  cout << '\n';
  return 0;
}
