#include <bits/stdc++.h>
using namespace std;
const int maxs = 1000005;
int a[maxs], y[maxs], used[maxs], appear[maxs];
int n, tot, cnt = 1;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    appear[a[i]] = true;
  }
  for (int i = 1; i <= n; i++) {
    if (!appear[1000001 - a[i]]) {
      y[tot++] = 1000001 - a[i];
    } else if (!used[a[i]]) {
      while (appear[cnt] || appear[1000001 - cnt]) cnt++;
      y[tot++] = cnt;
      y[tot++] = 1000001 - cnt;
      used[1000001 - a[i]] = 1;
      cnt++;
    }
  }
  printf("%d\n", tot);
  for (int i = 0; i < tot; i++) printf("%d ", y[i]);
  printf("\n");
  return 0;
}
