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