#include <bits/stdc++.h>
using namespace std;
int n;
int d[1000111];
vector<int> res;
int duplicate;
int main() {
  if (0 == 1) {
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
  }
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int number;
    scanf("%d", &number);
    d[number] = 1;
  }
  duplicate = 0;
  for (int i = 1; i <= 1000000 / 2; i++) {
    if (d[i] > 0 && d[1000000 - i + 1] == 0)
      res.push_back(1000000 - i + 1);
    else if (d[i] == 0 && d[1000000 - i + 1] > 0)
      res.push_back(i);
    else if (d[i] > 0 && d[1000000 - i + 1] > 0)
      duplicate++;
  }
  for (int i = 1; i <= 1000000 / 2; i++) {
    if (d[i] == 0 && d[1000000 - i + 1] == 0) {
      if (duplicate == 0) break;
      res.push_back(i);
      res.push_back(1000000 - i + 1);
      duplicate--;
    }
  }
  printf("%d\n", res.size());
  for (int i = 0; i <= res.size() - 1; i++) {
    printf("%d ", res[i]);
  }
  return 0;
}
