#include <bits/stdc++.h>
using namespace std;
int a[1000001];
int s = 1000000;
int n, t;
int main() {
  scanf("%d", &n);
  printf("%d\n", n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &t);
    a[t]++;
  }
  for (int i = 1; i <= s; i++)
    if (a[i] > 0 && a[s - i + 1] == 0) {
      printf("%d ", s - i + 1);
      n--;
    }
  for (int i = 1; i <= s && n > 0; i++)
    if (a[i] == 0 && a[s - i + 1] == 0) {
      printf("%d %d ", i, s - i + 1);
      n -= 2;
    }
  return 0;
}
