#include <bits/stdc++.h>
using namespace std;
const int s = 1e6;
int n;
bool X[s + 1];
bool used[s + 1];
int main() {
  scanf("%d", &n);
  long long sumx = 0;
  for (int i = 0; i < n; ++i) {
    int x;
    scanf("%d", &x);
    X[x] = true;
    used[x] = true;
    sumx += x - 1;
  }
  vector<int> out;
  out.reserve(s - n);
  int add = 0;
  for (int i = 1; i <= s; ++i)
    if (X[i]) {
      if (!X[s - i + 1]) {
        used[s - i + 1] = true;
        out.push_back(s - i + 1);
      } else {
        ++add;
        X[i] = X[s - i + 1] = false;
      }
    }
  for (int i = 1; add > 0 && i <= s; ++i) {
    if (!used[i] && !used[s - i + 1]) {
      out.push_back(i);
      out.push_back(s - i + 1);
      used[i] = used[s - i + 1] = true;
      --add;
    }
  }
  long long sumy = 0;
  for (int i = 0; i < ((int)(out).size()); ++i) sumy += s - out[i];
  assert(sumx == sumy);
  printf("%d\n", ((int)(out).size()));
  for (int i = 0; i < ((int)(out).size()); ++i)
    printf("%d%c", out[i], " \n"[i + 1 == ((int)(out).size())]);
  return 0;
}
