#include <bits/stdc++.h>
using namespace std;
int is[1000010];
int was[1000010];
vector<int> all, res;
int main() {
  int n;
  scanf("%d", &n);
  int s = 1000000;
  int now = 1;
  for (int i = (0); i < (n); ++i) {
    int x;
    scanf("%d", &x);
    is[x] = 1;
    all.push_back(x);
  }
  for (int i = (0); i < (all.size()); ++i) {
    int v = all[i];
    if (was[v]) continue;
    was[v] = 1;
    if (is[s - v + 1] == 0) {
      res.push_back(s - v + 1);
    } else {
      was[s - v + 1] = 1;
      while (1) {
        if ((is[now] == 0) && (is[s - now + 1] == 0)) {
          res.push_back(now);
          res.push_back(s - now + 1);
          now++;
          break;
        } else
          now++;
      }
    }
  }
  printf("%d\n", res.size());
  for (int i = (0); i < (res.size()); ++i) {
    if (i) printf(" ");
    printf("%d", res[i]);
  }
  printf("\n");
}
