#include <bits/stdc++.h>
using namespace std;
const int s = 1000000;
int n;
int x[s + 10];
bool use[s + 10];
int pos = 1;
int ans[s + 10];
int main() {
  memset(use, 0, sizeof(use));
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x[i]);
    use[x[i]] = 1;
  }
  ans[0] = 0;
  for (int i = 1; i <= n; i++) {
    if (!use[s + 1 - x[i]]) {
      ans[++ans[0]] = s + 1 - x[i];
      use[s + 1 - x[i]] = 1;
    } else if (x[i] <= 500000) {
      while (use[pos] || use[s - pos + 1]) pos++;
      ans[++ans[0]] = pos;
      ans[++ans[0]] = s - pos + 1;
      use[pos] = use[s - pos + 1] = 1;
    }
  }
  printf("%d\n", ans[0]);
  for (int i = 1; i <= ans[0]; i++) printf("%d ", ans[i]);
  puts("");
  return 0;
}
