#include <bits/stdc++.h>
using namespace std;
bool arr[1000000 + 10];
int main() {
  vector<int> v;
  int n, a, i;
  scanf(" %d", &n);
  for (i = 0; i < n; i++) {
    scanf(" %d", &a);
    arr[a] = 1;
  }
  for (i = 1; i <= 1000000; i++) {
    if (!arr[1000000 - i + 1] && arr[i]) {
      v.push_back(1000000 - i + 1);
    }
  }
  for (i = 1; i <= 1000000; i++) {
    if (v.size() == n) break;
    if (!arr[1000000 - i + 1] && !arr[i]) {
      v.push_back(1000000 - i + 1);
      v.push_back(i);
    }
  }
  sort(v.begin(), v.end());
  cout << v.size() << endl;
  for (i = 0; i < v.size(); i++) cout << v[i] << " ";
  return 0;
}
