#include <bits/stdc++.h>
using namespace std;
int n;
bool b[1000010];
int main() {
  scanf("%d", &n);
  printf("%d\n", n);
  for (int i = 1; i <= n; i++) {
    int tep;
    scanf("%d", &tep);
    b[tep] = 1;
  }
  for (int i = 1; i <= 1000000; i++)
    if (b[i] == true && b[1000000 + 1 - i] == false) {
      printf("%d ", 1000000 + 1 - i);
      n--;
    }
  for (int i = 1; i <= 1000000 && n > 0; i++)
    if (b[i] == false && b[1000000 + 1 - i] == false) {
      printf("%d %d ", i, 1000000 + 1 - i);
      n = n - 2;
    }
}
