#include <bits/stdc++.h>
using namespace std;
int v[1100000];
int x[1100000];
int ok[1100000];
int y[1100000];
int main() {
  int n, idx = 1;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &x[i]);
    v[x[i]] = 1;
  }
  int top = 0;
  for (int i = 0; i < n; i++)
    if (!ok[x[i]]) {
      ok[x[i]] = 1;
      if (!v[1000000 - x[i] + 1])
        y[top++] = 1000000 - x[i] + 1;
      else {
        while (v[idx] || v[1000000 - idx + 1]) idx++;
        ok[1000000 - x[i] + 1] = 1;
        y[top++] = idx;
        y[top++] = 1000000 - idx + 1;
        idx++;
      }
    }
  printf("%d\n", n);
  for (int i = 0; i < n; i++) printf("%d ", y[i]);
}
