#include <bits/stdc++.h>
using namespace std;
class C_ {};
template <typename T>
C_& operator<<(C_& m, const T& s) {
  if (!1) cerr << "\E[91m" << s << "\E[0m";
  return m;
}
C_ merr;
int u[1111111];
int main(void) {
  int n;
  vector<int> Y;
  int cnt = 0;
  const int s = 1000000;
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    u[x] = 1;
  }
  for (int i = 1; i <= s; i++) {
    if (u[i] == 1 && u[s - i + 1] == 1) cnt++;
    if (u[i] == 1 && u[s - i + 1] == 0) {
      Y.push_back(s - i + 1);
      u[s - i + 1] = 2;
    }
  }
  cnt /= 2;
  for (int i = 1; i <= s && cnt; i++) {
    if (u[i] == 0 && u[s - i + 1] == 0) {
      cnt--;
      Y.push_back(i);
      Y.push_back(s - i + 1);
      u[i] = u[s - i + 1] = 2;
    }
  }
  cout << Y.size() << endl;
  for (int i = 0; i < (int)Y.size(); i++) {
    cout << Y[i] << " ";
  }
  cout << endl;
  merr << "Execution time: " << fixed << setprecision(3)
       << (double)clock() / CLOCKS_PER_SEC << " s.\n";
  return 0;
}
