#include <bits/stdc++.h>
using namespace std;
template <class T>
void CIN(T &a) {
  cin >> a;
}
template <class T>
void CIN(T &a, T &b) {
  cin >> a >> b;
}
template <class T>
void CIN(T &a, T &b, T &c) {
  cin >> a >> b >> c;
}
template <class T>
void CIN(T &a, T &b, T &c, T &d) {
  cin >> a >> b >> c >> d;
}
template <class T>
void PI(T a) {
  cout << a << endl;
}
template <class T>
void PI(T a, T b) {
  cout << a << " " << b << endl;
}
template <class T>
void PIS(T a) {
  cout << a << " ";
}
template <class T>
T abs(T a) {
  return a < 0 ? -a : a;
}
const int N = 1000010, s = 1000000;
int n, a[N], ans[N];
bool f[N];
int main() {
  scanf("%d", &n);
  int i;
  for (i = 0; i < (int)(n); ++i) {
    scanf("%d", &a[i]);
    f[a[i]] = 1;
  }
  int m(0), c(0);
  for (i = 0; i < (int)(n); ++i) {
    if (!f[s + 1 - a[i]]) {
      f[s + 1 - a[i]] = 1;
      ans[m++] = s + 1 - a[i];
    } else
      ++c;
  }
  c /= 2;
  for (i = 1; i <= 1000000 && c; ++i) {
    if (!f[i]) {
      --c;
      ans[m++] = i;
      ans[m++] = s + 1 - i;
    }
  }
  PI(m);
  for (i = 0; i < (int)(m); ++i) printf("%d ", ans[i]);
  puts("");
  return 0;
}
