#include <bits/stdc++.h>
using namespace std;
string s, u;
const int N = 1e6;
vector<int> mk(N + 10, 0), mkl(N + 10, 0), a(N + 10, 0);
vector<int> ans;
int main() {
  int n;
  cin >> n;
  ans.reserve(1000000);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    mk[a[i]] = 1;
    mkl[a[i]] = 1;
  }
  int mx = 1e6;
  for (int i = 0; i < n; i++)
    if (mk[mx - a[i] + 1] == 0) {
      mk[mx - a[i] + 1] = 1;
      ans.push_back(mx - a[i] + 1);
    }
  int k1 = 0;
  for (int i = 1; i <= mx; i++)
    if (mkl[mx - i + 1] == 1 && mkl[i] == 1) {
      k1++;
    }
  k1 /= 2;
  for (int i = 1; i <= mx; i++)
    if (mkl[i] == 0 && mkl[mx - i + 1] == 0) {
      if (k1 == 0) break;
      ans.push_back(i);
      ans.push_back(mx - i + 1);
      k1--;
    }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << " ";
}
