#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
int a[1000005], b[1000005], dis[1000005], ans[1000005];
int main() {
  int n, i, j = 0, l = 1;
  memset(b, 0, sizeof(b));
  memset(dis, 0, sizeof(dis));
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    b[a[i]] = 1;
  }
  for (i = 0; i < n; i++) {
    if (dis[a[i]] == 0) {
      if (b[1000000 - a[i] + 1] == 0) {
        ans[j++] = 1000000 - a[i] + 1;
        b[1000000 - a[i] + 1] = 1;
      } else {
        while (b[l] || b[1000000 - l + 1]) l++;
        ans[j++] = l;
        b[l] = 1;
        ans[j++] = 1000000 - l + 1;
        b[1000000 - l + 1] = 1;
        dis[1000000 - a[i] + 1] = 1;
      }
    }
  }
  printf("%d\n%d", j, ans[0]);
  for (i = 1; i < j; i++) printf(" %d", ans[i]);
  return 0;
}
