#include <bits/stdc++.h>
using namespace std;
int INT_MAX_VAL = (int)1e20;
int INT_MIN_VAL = (int)-1e20;
long long LONG_MAX_VAL = (long long)1e20;
long long LONG_MIN_VAL = (long long)-1e20;
int main() {
  int X[1000005] = {0};
  bool was[1000005] = {0};
  long long n;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> X[i];
    was[X[i]] = 1;
  }
  long long s = 1000000;
  vector<long long> Y;
  long long last_ok = 1;
  for (int i = 0; i < n; i++) {
    long long inv = s + 1 - X[i];
    if (!was[inv]) {
      Y.push_back(inv);
      was[inv] = true;
    } else {
      if (X[i] > s / 2) {
        continue;
      }
      while (was[last_ok] || was[s - last_ok + 1]) {
        last_ok++;
      }
      Y.push_back(last_ok);
      Y.push_back(s - last_ok + 1);
      was[last_ok] = true;
      was[s - last_ok + 1] = true;
    }
  }
  printf("%d\n", (int)Y.size());
  for (vector<long long>::iterator it = Y.begin(); it != Y.end(); it++) {
    printf("%I64d ", *it);
  }
  printf("\n");
  return 0;
}
