#include <bits/stdc++.h>
using namespace std;
const int inf = 2000000000;
const int SZ = 1000000 + 7;
bool data[SZ];
int main(int argc, const char **argv) {
  int test, tmp, cnt;
  scanf("%d", &test);
  memset(data, true, sizeof(data));
  cnt = 0;
  for (int i = 1; i <= test; ++i) {
    scanf("%d", &tmp);
    data[tmp] = false;
    if (!data[(SZ - 6) - tmp]) cnt++;
  }
  printf("%d\n", test);
  for (int i = 1; i <= (SZ - 7); ++i) {
    if (data[i] and data[(SZ - 6) - i] and cnt) {
      printf("%d %d ", i, (SZ - 6) - i);
      cnt--;
    }
    if (data[i] and !data[(SZ - 6) - i]) printf("%d ", i);
  }
  return 0;
}
