#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e6 + 6;
const int S = 1e6;
bool taken[MAX];
int other(int x) { return S - x + 1; }
int main() {
  int n;
  scanf("%d", &n);
  for (int i = int(1); i < int(n + 1); i++) {
    int cur;
    scanf("%d", &cur);
    taken[cur] = true;
  }
  vector<int> ans;
  int pairs = 0;
  for (int i = int(1); i < int(S + 1); i++) {
    if (taken[i] && !taken[other(i)]) {
      ans.push_back(other(i));
    } else if (taken[i] && taken[other(i)]) {
      pairs++;
    }
  }
  pairs /= 2;
  for (int i = int(1); i < int(S + 1); i++) {
    if (pairs > 0 && !taken[i] && !taken[other(i)]) {
      ans.push_back(i);
      ans.push_back(other(i));
      taken[i] = taken[other(i)] = true;
      pairs--;
    }
  }
  printf("%d\n", (int)ans.size());
  for (auto &each : ans) {
    printf("%d ", each);
  }
  puts("");
  return 0;
}
