#include <bits/stdc++.h>
const int N = 1e6 + 5, INF = 0x3f3f3f3f, mod = 1e9 + 7;
const double PI = acos(-1), EPS = 1e-9;
using namespace std;
namespace fast_IO {
long long read() {
  long long x = 0;
  char c;
  bool flag = false;
  while ((c = getchar()) == ' ' || c == '\n' || c == '\r')
    ;
  if (c == '-')
    flag = true;
  else
    x = c ^ 48;
  while ((c = getchar()) >= '0' && c <= '9') x = (x << 1) + (x << 3) + (c ^ 48);
  if (flag) return -x;
  return x;
}
void write(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x >= 10) write(x / 10);
  putchar(x % 10 ^ 48);
}
}  // namespace fast_IO
int ans[N], tag[N], a[N], b[N];
int main() {
  int n = fast_IO::read();
  for (int i = 1; i <= n; ++i) tag[fast_IO::read()] = 1;
  for (int i = 1; i <= 1e6; ++i) {
    if (!tag[i]) {
      if (i <= 5e5 && !tag[1000000 - i + 1]) a[++*a] = i;
      continue;
    }
    if (!tag[1000000 - i + 1])
      ans[++*ans] = 1000000 - i + 1;
    else if (i <= 5e5)
      b[++*b] = i;
  }
  for (int i = 1; i <= *b && i <= *a; ++i) {
    ans[++*ans] = a[i];
    ans[++*ans] = 1000000 - a[i] + 1;
  }
  printf("%d\n", *ans);
  for (int i = 1; i <= *ans; ++i) printf("%d ", ans[i]);
  return 0;
}
