#include <bits/stdc++.h>
using namespace std;
int d[1000100];
int ans[1000100];
int main() {
  int i, j, n, h = 0, now;
  memset(d, 0, sizeof(d));
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    d[x] = 1;
  }
  now = 1;
  for (i = 1; i <= 1000000; i++) {
    if (d[i] == 1 && d[1000001 - i] == 0) ans[h++] = 1000001 - i;
    if (i <= 500000 && d[i] == 1 && d[1000001 - i] == 1) {
      while (d[now] == 1 || d[1000001 - now] == 1) now++;
      ans[h++] = now;
      ans[h++] = 1000001 - now;
      now++;
    }
  }
  sort(ans, ans + h);
  printf("%d\n", h);
  for (i = 0; i < h; i++) {
    printf("%d", ans[i]);
    if (i == h - 1)
      printf("\n");
    else
      printf(" ");
  }
}
