#include <bits/stdc++.h>
using namespace std;
const int SIZ = 1000000;
bool x[SIZ + 1], y[SIZ + 1];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int a;
    scanf("%d", &a);
    x[a] = 1;
  }
  int have = 0, rem = 0;
  for (int i = 1; i <= SIZ / 2; i++) {
    if (x[i] && x[SIZ - i + 1])
      rem++;
    else if (x[i]) {
      y[SIZ - i + 1] = 1;
      have++;
    } else if (x[SIZ - i + 1]) {
      y[i] = 1;
      have++;
    }
  }
  for (int i = 1; i <= SIZ / 2 && rem > 0; i++) {
    if (x[i] || x[SIZ - i + 1] || y[i] || y[SIZ - i + 1]) continue;
    y[i] = y[SIZ - i + 1] = 1;
    have += 2;
    rem--;
  }
  printf("%d\n", have);
  for (int i = 1; i <= SIZ; i++)
    if (y[i]) printf("%d ", i);
  return 0;
}
