#include <bits/stdc++.h>
using namespace std;
int n;
int a[1000005], b[1000005];
bool vis1[1000005], vis2[1000005];
int main() {
  memset(vis1, false, sizeof(vis1));
  memset(vis2, false, sizeof(vis2));
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    vis1[a[i]] = true;
  }
  int len = 0;
  int k = 1;
  for (int i = 1; i <= n; i++)
    if (!vis2[a[i]]) {
      vis2[a[i]] = true;
      if (vis1[1000000 - a[i] + 1]) {
        while (k <= 1000000 && (vis1[k] || vis1[1000000 - k + 1])) k++;
        b[++len] = k;
        b[++len] = 1000000 - k + 1;
        vis1[k] = true;
        vis1[1000000 - k + 1] = true;
        vis2[1000000 - a[i] + 1] = true;
      } else {
        b[++len] = 1000000 - a[i] + 1;
        vis1[1000000 - a[i] + 1] = true;
      }
    }
  printf("%d\n", len);
  sort(b + 1, b + 1 + len);
  printf("%d", b[1]);
  for (int i = 2; i <= len; i++) printf(" %d", b[i]);
  return 0;
}
