#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 2;
void solve() {
  int n, both = 0;
  cin >> n;
  vector<int> numsInX(n), y;
  vector<bool> x(N, false);
  for (int i = 0; i < n; i += 1) {
    cin >> numsInX[i];
    x[numsInX[i]] = true;
  }
  auto symmetric = [&](int i) -> int { return 1e6 - i + 1; };
  for (auto it : numsInX) {
    if (x[it] == false) continue;
    int rev = symmetric(it);
    if (!x[rev]) {
      y.push_back(rev);
    } else {
      both += 1;
      x[rev] = false;
    }
  }
  for (int i = 1; i <= 1e6 && both > 0; i += 1) {
    if (!x[i] && !x[symmetric(i)] && i != symmetric(i)) {
      both -= 1;
      y.push_back(i);
      y.push_back(symmetric(i));
      x[i] = true;
    }
  }
  sort(y.begin(), y.end());
  cout << y.size() << '\n';
  for (auto it : y) cout << it << ' ';
  cout << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int test = 1;
  while (test--) solve();
  return 0;
}
