#include <bits/stdc++.h>
using namespace std;
bool vis1[1000005], vis2[1000005];
void solve() {
  long long int n;
  cin >> n;
  long long int x;
  for (int i = 0; i < n; i++) {
    cin >> x;
    vis1[x] = 1;
  }
  long long int lim = 1e6;
  long long int need = 0;
  for (int i = 1; i < lim + 1; i++) {
    if (vis1[i]) {
      if (!vis1[lim - i + 1])
        vis2[lim - i + 1] = 1;
      else
        need++;
    }
  }
  need /= 2;
  if (need > 0)
    for (int i = 1; i < lim + 1; i++) {
      if (!vis1[i] && !vis2[i] && !vis1[lim - i + 1] && !vis2[lim - i + 1]) {
        vis2[i] = 1;
        vis2[lim - i + 1] = 1;
        need--;
        if (!need) break;
      }
    }
  long long int ans = 0;
  vector<long long int> v;
  for (int i = 0; i < lim + 1; i++) {
    if (vis2[i]) ans++, v.push_back(i);
  }
  cout << ans << endl;
  for (auto it : v) cout << it << ' ';
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
