#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:2000000000")
using namespace std;
const long long inf = 1e18 + 7;
const long long mod = 1e9 + 7;
const double eps = 1e-9;
const double PI = 2 * acos(0.0);
const double E = 2.71828;
int n;
int x[1000005];
bool used[1000005];
bool ok[1000005];
int res[1000005], sz;
int a[1000005], size;
int main(void) {
  scanf("%d", &n);
  for (int(i) = 0; (i) < (long long)(n); ++(i)) {
    scanf("%d", x + i);
    used[x[i]] = true;
  }
  for (int(i) = 0; (i) < (long long)(n); ++(i)) {
    int now = 1000000 - x[i] + 1;
    if (!used[now]) {
      used[now] = true;
      ok[x[i]] = true;
      res[sz++] = now;
    }
  }
  for (int i = 1; i <= 1000000; ++i) {
    int now = 1000000 - i + 1;
    if (!used[i] && !used[now]) {
      a[size++] = i;
    }
  }
  for (int(i) = 0; (i) < (long long)(n); ++(i)) {
    if (!ok[x[i]]) {
      int now = 1000000 - x[i] + 1;
      res[sz++] = a[size - 1];
      res[sz++] = 1000000 - a[size - 1] + 1;
      --size;
      ok[x[i]] = true;
      ok[now] = true;
    }
  }
  printf("%d\n", sz);
  for (int(i) = 0; (i) < (long long)(sz); ++(i)) {
    printf("%d ", res[i]);
  }
  printf("\n");
  return 0;
}
