#include <bits/stdc++.h>
bool vis[1000000 + 10];
int x[1000000 + 10];
int ans[1000000];
int top;
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    memset(vis, 0, sizeof(vis));
    for (int i = 0; i < n; i++) {
      scanf("%d", &x[i]);
      vis[x[i]] = true;
    }
    int doubleCnt = 0;
    top = 0;
    for (int i = 0; i < n; i++) {
      if (vis[1000000 - (x[i] - 1)])
        doubleCnt++;
      else {
        ans[top++] = 1000000 - (x[i] - 1);
        vis[1000000 - (x[i] - 1)] = true;
      }
    }
    for (int i = 1; i <= 1000000; i++) {
      if (doubleCnt == 0) break;
      if (vis[i] == false) {
        ans[top++] = i;
        ans[top++] = 1000000 - (i - 1);
        vis[i] = vis[1000000 - (i - 1)] = true;
        doubleCnt -= 2;
      }
    }
    printf("%d\n", top);
    for (int i = 0; i < top; i++) {
      printf(i == 0 ? "%d" : " %d", ans[i]);
    }
    puts("");
  }
  return 0;
}
