#include <bits/stdc++.h>
int n, i;
int f[1000001 + 1];
int main() {
  scanf("%d", &n);
  int k;
  int sum = 0;
  for (i = 1; i <= n; i++) {
    scanf("%d", &k);
    f[k] = 1;
    sum++;
  }
  printf("%d\n", sum);
  int nCnt = 0;
  for (i = 1; i <= 1000001; i++)
    if (f[i] == 1 && f[1000001 - i] == 0) {
      printf("%d ", 1000001 - i);
      f[1000001 - i] = 1;
      nCnt++;
    }
  for (i = 1; i <= 1000001; i++)
    if (nCnt < sum) {
      if (f[i] == 0 && f[1000001 - i] == 0) {
        printf("%d %d ", i, 1000001 - i);
        nCnt += 2;
      }
    }
  return 0;
}
