#include <bits/stdc++.h>
using namespace std;
long long as[1000001];
const long long s = 1000000;
signed main(void) {
  ios::sync_with_stdio(false);
  long long n;
  cin >> n;
  vector<long long> xs(n);
  for (long long i = 0; i < (long long)n; ++i) cin >> xs[i];
  for (auto x : xs) as[x] = 1;
  queue<pair<long long, long long> > que;
  for (long long i = 1; i < (long long)s + 1; ++i) {
    if (as[i] == 1) continue;
    if (s - i + 1 < i) break;
    if (as[s - i + 1] == 0) {
      que.push({i, s - i + 1});
    }
  }
  vector<long long> ans;
  for (auto x : xs) {
    if (as[x] == 0) continue;
    if (as[s - x + 1] == 0)
      ans.emplace_back(s - x + 1);
    else {
      ans.emplace_back(que.front().first);
      ans.emplace_back(que.front().second);
      as[x] = 0;
      as[s - x + 1] = 0;
      que.pop();
    }
  }
  cout << ans.size() << "\n";
  for (auto a : ans) cout << a << "\n";
  return 0;
}
