#include <bits/stdc++.h>
using namespace std;
const long long sz = 5e5 + 10, MAX_N = 1e6;
long long X[sz];
bool take[MAX_N + 10];
vector<long long> Y;
int main() {
  long long n;
  cin >> n;
  for (long long i = 1; i <= n; ++i) {
    scanf("%lld", &X[i]);
    take[X[i]] = 1;
  }
  long long cnt = 0;
  for (long long i = 1; i <= n; ++i) {
    long long sym = MAX_N - X[i] + 1;
    if (!take[sym]) {
      Y.push_back(sym);
      take[sym] = 1;
    } else
      cnt++;
  }
  for (long long i = 1, y = 1; i <= cnt; y++) {
    long long y2 = (MAX_N - y + 1);
    if (!take[y] && !take[y2]) {
      Y.push_back(y), Y.push_back(y2);
      take[y] = take[y2] = 1;
      i += 2;
    }
  }
  sort(Y.begin(), Y.end());
  cout << Y.size() << '\n';
  for (long long &y : Y) printf("%lld ", y);
  printf("\n");
  return 0;
}
