#include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-5;
bool used[1000001];
int main() {
  int n;
  scanf("%d", &n);
  memset(used, false, sizeof(used));
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    used[x] = true;
  }
  vector<int> ans;
  vector<int> freepair;
  int cnt = 0;
  for (int i = 1; i < 1000001; i++) {
    if (used[i] && used[1000001 - i] == false) {
      ans.push_back(1000001 - i);
    }
    if (used[i] == false && used[1000001 - i] == false && i < 1000001 - i) {
      freepair.push_back(i);
    }
    if (used[i] && used[1000001 - i] && i < 1000001 - i) cnt++;
  }
  for (int i = 0; i < cnt; i++) {
    ans.push_back(freepair[i]);
    ans.push_back(1000001 - freepair[i]);
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) {
    printf("%d ", ans[i]);
  }
  printf("\n");
  return 0;
}
