#include <bits/stdc++.h>
using namespace std;
const long long LLINF = 1e18;
const int INF = 1e9;
const double EPS = 1e-9;
int INT() {
  int x;
  scanf("%d", &x);
  return x;
}
long long LONG() {
  long long x;
  scanf("%lld", &x);
  return x;
}
const int NN = 1e6 + 7;
int N = 1e6;
int n, a[NN];
bool mark[NN];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < (n); ++i) scanf("%d", &a[i]);
  for (int i = 0; i < (n); ++i) mark[a[i]] = 1;
  vector<int> ans;
  int cnt = 0;
  for (int i = 0; i < (n); ++i) {
    int x = N - a[i] + 1;
    if (!mark[x]) {
      mark[x] = 1;
      ans.push_back(x);
    } else {
      ++cnt;
    }
  }
  cnt /= 2;
  for (int i = (1); i <= (N / 2); ++i) {
    if (!cnt) break;
    if (mark[i]) continue;
    ans.push_back(i);
    ans.push_back(N - i + 1);
    --cnt;
  }
  printf("%d\n", (int)ans.size());
  for (int i = 0; i < (ans.size()); ++i) {
    printf("%d ", ans[i]);
  }
  return 0;
}
