#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000000;
const int INF = 0x7f7f7f7f;
int cases;
template <class T>
inline void read(T& x) {
  int c;
  for (c = getchar(); c <= 32 && ~c; c = getchar())
    ;
  for (x = 0; c > 32; x = x * 10 + c - '0', c = getchar())
    ;
}
bool is[MAXN + 1];
int main() {
  int n, x;
  read(n);
  for (int i = 0; i < n; i++) {
    read(x);
    is[x] = 1;
  }
  printf("%d\n", n);
  int cnt = 0;
  for (int i = 1; i <= MAXN; i++) {
    if (is[i] && !is[MAXN - i + 1]) {
      printf("%d ", MAXN - i + 1);
      ++cnt;
    }
  }
  for (int i = 1; cnt < n && i <= MAXN; i++) {
    if (!is[i] && !is[MAXN - i + 1]) {
      printf("%d %d ", i, MAXN - i + 1);
      ++cnt;
      ++cnt;
    }
  }
}
