#include <bits/stdc++.h>
using namespace std;
int arr[1000002] = {0};
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int inp;
    cin >> inp;
    arr[inp] = 1;
  }
  int cnt = 0;
  for (int i = 1; i <= 1000000; i++) {
    if (arr[i] == 1) {
      if (arr[1000000 - i + 1] == 0) {
        arr[1000000 - i + 1] = 2;
      } else if (arr[1000000 - i + 1] == 1) {
        cnt++;
      }
    }
  }
  cnt /= 2;
  for (int i = 1; i <= 1000000 / 2; i++) {
    if (!cnt) break;
    if (!arr[i]) {
      arr[i] = arr[1000000 - i + 1] = 2;
      cnt--;
    }
  }
  vector<int> out;
  for (int i = 1; i <= 1000000; i++) {
    if (arr[i] == 2) out.push_back(i);
  }
  cout << out.size() << endl;
  for (auto it : out) {
    cout << it << " ";
  }
  cout << endl;
  return 0;
}
