#include <bits/stdc++.h>
using namespace std;
int a[1000005];
int n, s = 1000005 - 5;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    int ch;
    scanf("%d", &ch);
    ++a[ch];
  }
  printf("%d\n", n);
  for (int i = 1; i <= 1000005 - 5; ++i) {
    if (a[i] > 0 && a[s - i + 1] == 0) {
      printf("%d ", s - i + 1);
      --n;
    }
  }
  for (int i = 1; i <= s && n; ++i) {
    if (a[i] == 0 && a[s - i + 1] == 0) {
      printf("%d %d ", i, s - i + 1);
      n -= 2;
    }
  }
  return 0;
}
