#include <bits/stdc++.h>
using namespace std;
const int CNT = (int)1e6;
int main() {
  int n;
  cin.sync_with_stdio(false);
  cout.sync_with_stdio(false);
  cin >> n;
  bool *enemy = new bool[CNT + 1];
  int *answ = new int[n];
  for (int i = 0; i < n; i++) {
    int t;
    cin >> t;
    enemy[t] = true;
  }
  int needPair = 0;
  int answCnt = 0;
  for (int first = 1; first <= CNT / 2; first++) {
    int second = CNT - first + 1;
    if (enemy[first] && !enemy[second]) {
      answ[answCnt++] = second;
    } else if (!enemy[first] && enemy[second]) {
      answ[answCnt++] = first;
    } else if (enemy[first] && enemy[second])
      needPair++;
    else {
    }
  }
  int ind = 0;
  while (needPair > 0) {
    int first = ind + 1;
    int second = CNT - first + 1;
    if (!enemy[first] && !enemy[second]) {
      needPair--;
      answ[answCnt++] = first;
      answ[answCnt++] = second;
    }
    ind++;
  }
  cout << answCnt << endl;
  for (int i = 0; i < answCnt; i++) {
    cout << answ[i];
    cout << ' ';
  }
  return 0;
}
