#include <bits/stdc++.h>
using namespace std;
int use[1000010];
int ans[1000010];
int can[1000010];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    use[x]++;
  }
  int cntt = 0;
  for (int i = 1; i <= 500000; i++) {
    if (!use[i] && !use[1000001 - i]) {
      can[cntt++] = i;
    }
  }
  int cntt2 = 0, pos = 0;
  for (int i = 1; i <= 500000; i++) {
    if (use[i] && !use[1000001 - i]) {
      ans[cntt2++] = 1000001 - i;
    } else if (!use[i] && use[1000001 - i]) {
      ans[cntt2++] = i;
    } else if (use[i] && use[1000001 - i]) {
      ans[cntt2++] = can[pos];
      ans[cntt2++] = 1000001 - can[pos];
      pos++;
    }
  }
  printf("%d\n", cntt2);
  for (int i = 0; i < cntt2; i++) {
    if (i) printf(" ");
    printf("%d", ans[i]);
  }
  puts("");
  return 0;
}
