#include <bits/stdc++.h>
using namespace std;
bool US[1000001];
bool T[1000001];
int main() {
  int n, x;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &x);
    US[x] = true;
    T[x] = true;
  }
  vector<int> tp;
  x = 1;
  for (int i = 1; i <= 1000000; i++) {
    if (US[i]) {
      if (US[1000001 - i] == false) {
        T[1000001 - i] = true;
        tp.push_back(1000001 - i);
        US[i] = false;
      } else {
        while (T[x] || T[1000001 - x]) x++;
        T[x] = true;
        T[1000001 - x] = true;
        tp.push_back(x);
        tp.push_back(1000001 - x);
        US[i] = false;
        US[1000001 - i] = false;
      }
    }
  }
  cout << (int)(tp.size()) << endl;
  for (typeof(tp.begin()) i(tp.begin()); i != tp.end(); i++) printf("%d ", *i);
  cout << endl;
  return 0;
}
