#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  const int S = 1000000;
  int N;
  cin >> N;
  set<int> X;
  for (int i = 0; i < N; ++i) {
    int cur;
    cin >> cur;
    X.insert(cur);
  }
  int both_in = 0;
  vector<int> ans;
  for (__typeof((X).begin()) i = (X).begin(), _i = (X).end(); i != _i; ++i) {
    if (X.count(S + 1 - *i)) {
      ++both_in;
    } else {
      ans.push_back(S + 1 - *i);
    }
  }
  int need = both_in / 2;
  for (int i = 1; i <= S && need > 0; ++i) {
    if (!X.count(i) && !X.count(S + 1 - i)) {
      ans.push_back(i);
      ans.push_back(S + 1 - i);
      --need;
    }
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); ++i) {
    if (i) cout << ' ';
    cout << ans[i];
  }
  cout << endl;
  return 0;
}
