#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream& operator<<(ostream& out, vector<T> const& a) {
  out << "[";
  for (int i = 0; i < int((a).size()); ++i) {
    if (i != 0) {
      out << ", ";
    }
    out << a[i];
  }
  out << "]";
  return out;
}
template <typename T1, typename T2>
ostream& operator<<(ostream& out, pair<T1, T2> const& p) {
  out << "(" << p.first << ", " << p.second << ")";
  return out;
}
const int S = 1000000;
const int N = 500000;
struct Data {
  int n;
  int a[N];
  bool read() {
    if (!(cin >> n)) {
      return 0;
    }
    for (int i = 0; i < int(n); ++i) {
      scanf("%d", &a[i]);
      --a[i];
    }
    return 1;
  }
  vector<int> ans;
  void write() {
    cout << ans.size() << endl;
    for (int i = 0; i < int(ans.size()); ++i) {
      if (i) {
        printf(" ");
      }
      printf("%d", ans[i] + 1);
    }
    puts("");
  }
  virtual void solve() {}
  virtual void clear() { *this = Data(); }
};
struct Solution : Data {
  bool u[S];
  void solve() {
    memset(u, 0, sizeof u);
    for (int i = 0; i < int(n); ++i) {
      u[a[i]] = 1;
    }
    int k = 0;
    for (int i = 0; i < int(S / 2); ++i) {
      if (u[i] && u[S - 1 - i]) {
        ++k;
      }
    }
    for (int i = 0; i < int(S / 2); ++i) {
      if (u[i] ^ u[S - 1 - i]) {
        if (u[i]) {
          ans.push_back(S - 1 - i);
        } else {
          ans.push_back(i);
        }
      }
      if (!u[i] && !u[S - 1 - i] && k) {
        ans.push_back(i);
        ans.push_back(S - 1 - i);
        --k;
      }
    }
  }
  Solution(Data d = Data()) : Data(d) {}
  void clear() { *this = Solution(); }
};
Solution sol;
int main() {
  sol.read();
  sol.solve();
  sol.write();
  return 0;
}
