#include <bits/stdc++.h>
using namespace std;
int n, a[1001000], cnt;
bool b[1001000];
vector<int> pr;
int main() {
  int half = 500000, s = 1000000;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), b[a[i]] = true;
  for (int i = 1; i <= n; i++) {
    if (b[s - a[i] + 1]) {
      cnt++;
    } else
      pr.push_back(s - a[i] + 1);
  }
  cnt /= 2;
  for (int i = 1; i <= half; i++) {
    if (cnt == 0) break;
    if (!b[i] && !b[s - i + 1]) cnt--, pr.push_back(i), pr.push_back(s - i + 1);
  }
  sort(pr.begin(), pr.end());
  printf("%d\n", pr.size());
  for (int i = 0; i < pr.size(); i++) printf("%d ", pr[i]);
  printf("\n");
  return 0;
}
