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