#include <bits/stdc++.h>
void scan(int* i) {
  int t = 0;
  char c;
  bool negative = false;
  c = getchar_unlocked();
  while (c < '0' || c > '9') {
    if (c == '-') negative = true;
    c = getchar_unlocked();
  }
  while (c >= '0' && c <= '9') {
    t = (t << 3) + (t << 1) + c - '0';
    c = getchar_unlocked();
  }
  if (negative) t = ~(t - 1);
  *i = t;
}
void scan(long long int* i) {
  long long int t = 0;
  char c;
  bool negative = false;
  c = getchar_unlocked();
  while (c < '0' || c > '9') {
    if (c == '-') negative = true;
    c = getchar_unlocked();
  }
  while (c >= '0' && c <= '9') {
    t = (t << 3) + (t << 1) + c - '0';
    c = getchar_unlocked();
  }
  if (negative) t = ~(t - 1);
  *i = t;
}
struct debugger {
  template <typename T>
  debugger& operator,(const T& v) {
    std::cout << v << " ";
    return *this;
  }
} dbg;
template <typename T1, typename T2>
inline std::ostream& operator<<(std::ostream& os, const std::pair<T1, T2>& p) {
  return os << "(" << p.first << ", " << p.second << ")";
}
template <typename T>
inline std::ostream& operator<<(std::ostream& os, const std::vector<T>& v) {
  std::string delim = "[";
  for (unsigned int i = 0; i < v.size(); i++) {
    os << delim << v[i];
    delim = ", ";
  }
  return os << "]";
}
template <typename T>
inline std::ostream& operator<<(std::ostream& os, const std::set<T>& v) {
  std::string delim = "[";
  for (typename std::set<T>::const_iterator ii = v.begin(); ii != v.end();
       ++ii) {
    os << delim << *ii;
    delim = ", ";
  }
  return os << "]";
}
template <typename T1, typename T2>
inline std::ostream& operator<<(std::ostream& os, const std::map<T1, T2>& v) {
  std::string delim = "[";
  for (typename std::map<T1, T2>::const_iterator ii = v.begin(); ii != v.end();
       ++ii) {
    os << delim << *ii;
    delim = ", ";
  }
  return os << "]";
}
using namespace std;
int T;
int main(int argc, char const* argv[]) {
  int n, u;
  scan(&n);
  vector<int> x;
  int S = 1000000;
  vector<int> m(1000001, 0), used(1000001, 0);
  for (int i = 0; i < n; i++) {
    scan(&u);
    x.push_back(u);
    m[u] = 1;
    used[u] = 1;
  }
  vector<int> ans, v;
  int miss = 1;
  for (int i = 0; i < n; i++) {
    if (m[x[i]] == 1) {
      u = 1000000 - (x[i] - 1);
      if (m[u] == 0) {
        ans.push_back(u);
        used[u] = 1;
        m[u] = 1;
      } else {
        m[u] = 0;
        v.push_back(x[i]);
      }
    }
  }
  int pp = ((int)(v.size()));
  for (int i = 0; i < pp; i++) {
    int k = S + 1;
    while ((used[miss] == 1 || used[k - miss] == 1)) {
      miss++;
    }
    ans.push_back(miss);
    ans.push_back(k - miss);
    used[miss] = 1;
    used[k - miss] = 1;
    miss++;
  }
  printf("%d\n", ((int)(ans.size())));
  int l = ((int)(ans.size()));
  for (int i = 0; i < l; i++) {
    printf("%d", ans[i]);
    if (i == l - 1) {
      printf("\n");
    } else
      printf(" ");
  }
  return 0;
}
