#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:640000000")
using namespace std;
const double eps = 1e-9;
const double pi = acos(-1.0);
const int maxn = (int)5e5 + 10;
int x[maxn], y[2 * maxn];
bool used[2 * maxn];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    scanf("%d", &x[i]);
    used[x[i]] = true;
  }
  sort(x, x + n);
  int S = 1000000;
  int m = 0;
  for (int i = 0; i < n; i++) {
    int Y = S - x[i] + 1;
    if (binary_search(x, x + n, Y)) continue;
    y[m++] = Y;
    used[Y] = true;
  }
  int l = 1;
  for (int i = 0; i < n; i++) {
    int Y = S - x[i] + 1;
    if (!binary_search(x, x + n, Y) || x[i] > Y) continue;
    while (used[l] || used[S - l + 1]) l++;
    used[l] = true;
    used[S - l + 1] = true;
    y[m++] = l;
    y[m++] = S - l + 1;
    l++;
  }
  cout << m << endl;
  for (int i = 0; i < m; i++) {
    printf("%d ", y[i]);
  }
  return 0;
}
