#include <bits/stdc++.h>
using namespace std;
const int INF = 0x7fffffff;
const int MINF = 0x80000000;
const long long mod = 1000000007;
const int cons = 1000001;
bool judgex[cons];
int bx[cons];
long long xsum = 0;
vector<int> cy;
vector<int> y;
void printans(vector<int> y) {
  printf("%d\n", y.size());
  for (int i = 0; i < y.size(); i++) {
    printf("%d ", y[i]);
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    scanf("%d", &bx[i]);
    judgex[bx[i]] = true;
  }
  sort(bx, bx + n);
  int x = 0;
  vector<int> tmp;
  for (int i = 0; i < n; i++) {
    if (judgex[cons - bx[i]] == false) tmp.push_back(bx[i]);
  }
  for (int i = 0; i < tmp.size(); i++) {
    y.push_back(cons - tmp[i]);
    judgex[cons - tmp[i]] = true;
  }
  int rem = n - y.size();
  for (int i = 1; rem > 0 && i < cons; i++) {
    if (judgex[cons - i] == false) {
      y.push_back(cons - i);
      y.push_back(i);
      rem -= 2;
    }
  }
  printans(y);
  return 0;
}
