#include <bits/stdc++.h>
using namespace std;
int p[1000010];
int q[1000010];
int f[1000010];
int main() {
  int n;
  scanf("%d", &n);
  int i, j, k;
  memset(f, 0, sizeof(f));
  for (i = 1; i <= n; i++) {
    scanf("%d", &k);
    f[k] = 1;
  }
  int t = 1000001, ans, sum = 0, cnt = 0, cn = 0;
  for (i = 1; i <= 500000; i++) {
    ans = f[i] + f[t - i];
    if (ans == 2)
      sum++;
    else if (ans == 1) {
      if (f[i] == 0)
        p[cnt++] = i;
      else if (f[t - i] == 0)
        p[cnt++] = t - i;
    } else if (ans == 0) {
      q[cn++] = i;
    }
  }
  while (sum--) {
    ans = q[cn - 1];
    cn--;
    p[cnt++] = ans;
    p[cnt++] = t - ans;
  }
  printf("%d\n", n);
  for (i = 0; i < cnt - 1; i++) printf("%d ", p[i]);
  printf("%d\n", p[cnt - 1]);
}
