#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1.0);
const long double EPS = 1e-9;
const int INF = 1000000000;
const long long INFL = (long long)1000000000 * (long long)1000000000;
const int NULO = -1;
const string INPUT_FILE = "input.txt";
const string OUTPUT_FILE = "output.txt";
template <class T>
inline int cmpf(T X, T Y = 0, T EPS_DIST = EPS) {
  return (X <= Y + EPS_DIST) ? ((X + EPS_DIST < Y) ? -1 : 0) : +1;
}
template <class T>
inline T gcd(T A, T B) {
  return (A < 0) ? gcd(-A, B)
                 : ((B < 0) ? gcd(A, -B) : ((0 == B) ? A : gcd(B, A % B)));
}
template <class T>
inline T lcm(T A, T B) {
  return (A < 0) ? lcm(-A, B) : ((B < 0) ? lcm(A, -B) : (A * (B / gcd(A, B))));
}
template <class T>
inline string tos(T X) {
  ostringstream oss;
  oss << X;
  oss.flush();
  return oss.str();
}
template <class T>
inline void fmin(T& B, T A) {
  if (A < B) B = A;
}
template <class T>
inline void fmax(T& B, T A) {
  if (A > B) B = A;
}
template <class T>
inline T sqr(T X) {
  return X * X;
}
inline bool isUpper(char C) { return C >= 'A' && C <= 'Z'; }
inline bool isLower(char C) { return C >= 'a' && C <= 'z'; }
inline bool isLetter(char C) { return isUpper(C) || isLower(C); }
inline int toI(char C) {
  return isUpper(C) ? (int)(C - 'A') : (isLower(C) ? (int)(C - 'a') : -1);
}
inline bool isDigit(char C) { return C >= '0' && C <= '9'; }
inline char toLower(char C) { return (isUpper(C)) ? (C + 32) : C; }
inline char toUpper(char C) { return (isLower(C)) ? (C - 32) : C; }
inline int toInt(string S) {
  int value;
  istringstream iss(S);
  iss >> value;
  return value;
}
inline double toF(string S) {
  double value;
  istringstream iss(S);
  iss >> value;
  return value;
}
const int MAXN = 1000000 + 10;
const int MAXS = 1000000;
int N;
bool teacherX[MAXN];
int main() {
  scanf("%d", &N);
  memset(teacherX, false, sizeof(teacherX));
  for (int i = (int)(0); i < (int)(N); ++i) {
    int x;
    scanf("%d", &x);
    teacherX[x] = true;
  }
  printf("%d\n", N);
  int nHasPairs = N;
  for (int i = (int)(1); i <= (int)(MAXS); ++i)
    if (teacherX[i] && !teacherX[MAXS - i + 1]) {
      printf("%d ", MAXS - i + 1);
      --nHasPairs;
    }
  int i = 1;
  while (i <= MAXS && nHasPairs) {
    if (!(!teacherX[i] && !teacherX[MAXS - i + 1])) {
      ++i;
      continue;
    }
    printf("%d %d ", i, MAXS - i + 1);
    teacherX[i] = true;
    nHasPairs -= 2;
  }
  return 0;
}
