#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1000001;
const int MAX_M = 100001;
const int MOD = 1e9 + 7.5;
const double EPS = 1e-8;
bool used[MAX_N];
int main() {
  int n, val;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &val);
    used[val] = true;
  }
  vector<int> v;
  int p = 0, s = 1000000;
  for (int i = 1; i <= 1000000; i++)
    if (used[i]) {
      if (used[s - (i - 1)]) {
        if (i <= 500000) ++p;
      } else {
        v.push_back(s - (i - 1));
        used[s - (i - 1)] = true;
      }
    }
  for (int i = 1; i <= 1000000; i++)
    if (!used[i] && !used[s - i + 1]) {
      if (p-- <= 0) break;
      used[i] = used[s - i + 1] = true;
      v.push_back(i);
      v.push_back(s - i + 1);
    }
  printf("%d\n", (int)v.size());
  for (int i = 0; i < v.size(); i++) printf("%d ", v[i]);
  puts("");
  return 0;
}
