#include <bits/stdc++.h>
const int maxn = 1e6 + 11;
const int maxm = 1e6 + 1;
int a[maxn];
bool vis[maxn];
std::priority_queue<int, std::vector<int>, std::greater<int> > qu;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    vis[a[i]] = true;
  }
  int sum = 0, cnt = 0;
  for (int i = 0; i < n; i++) {
    if (vis[a[i]]) {
      int u = maxm - a[i];
      if (vis[u])
        ++sum;
      else {
        cnt++;
        vis[u] = true;
        qu.push(u);
      }
    }
  }
  for (int i = 1; i < maxm && sum > 0; i++) {
    if (!vis[i] && !vis[maxm - i]) {
      qu.push(i);
      qu.push(maxm - i);
      vis[i] = true;
      vis[maxm - i] = true;
      sum -= 2;
      cnt += 2;
    }
  }
  printf("%d\n", cnt);
  while (!qu.empty()) {
    int u = qu.top();
    qu.pop();
    printf("%d ", u);
  }
  return 0;
}
