#include <bits/stdc++.h>
using namespace std;
const int s = 1e6, h = 5e5;
int n;
int r[h + 1];
bool is[s + 1];
int main() {
  scanf("%d", &n);
  int x;
  for (int i = 0; i <= n - 1; ++i) {
    scanf("%d", &x);
    if (x <= h)
      r[x]++;
    else
      r[s - x + 1]++;
    is[x] = 1;
  }
  int twos = 0;
  for (int i = 1; i <= h; ++i)
    if (r[i] == 2) twos++;
  printf("%d\n", n);
  for (int i = 1; i <= h; ++i) {
    if (twos > 0 && r[i] == 0) {
      printf("%d %d ", i, s - i + 1);
      twos--;
    } else if (r[i] == 1) {
      if (is[i])
        printf("%d ", s - i + 1);
      else
        printf("%d ", i);
    }
  }
}
