#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, s = 1000000;
  cin >> n;
  vector<int> a(n);
  vector<bool> mask(s + 1, false);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    mask[a[i]] = true;
  }
  int cnt = 0;
  vector<int> res;
  for (int i = 1; i <= s; i++) {
    if (mask[i]) {
      if (mask[s - i + 1])
        cnt++;
      else {
        res.push_back(s - i + 1);
      }
    }
  }
  cnt /= 2;
  int cur = 0;
  for (int i = 1; i <= s; i++) {
    if (cur == cnt) break;
    if (!mask[i] && !mask[s - i + 1]) {
      res.push_back(i);
      res.push_back(s - i + 1);
      cur++;
    }
  }
  cout << res.size() << endl;
  for (int i = 0; i < res.size(); i++) {
    printf("%d", res[i]);
    if (i + 1 != res.size()) printf(" ");
  }
}
