#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
int n, a[1000000 + 100];
bool vis[1000000 + 100], vis2[1000000 + 100];
vector<int> ansv;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", a + i);
    vis[a[i]] = true;
  }
  int num = 0;
  for (int i = 1; i <= n; i++) {
    int t = 1000000 + 1 - a[i];
    if (!vis[t]) {
      vis[t] = true;
      ansv.push_back(t);
    } else
      num += 1;
  }
  num >>= 1;
  for (int i = 1; i <= 1000000; i++) {
    if (!vis[i]) vis2[1000000 - i] = true;
  }
  for (int i = 1; i <= 1000000; i++) {
    if (!num) break;
    if (vis2[i]) {
      int t = 1000000 - 1 - i;
      if (t >= 0 && vis2[t]) {
        vis2[i] = vis2[t] = false;
        num -= 1;
        ansv.push_back(1000000 - i);
        ansv.push_back(1000000 - t);
      }
    }
  }
  sort(ansv.begin(), ansv.end());
  printf("%d\n", (int)ansv.size());
  for (int i = 0; i < (int)ansv.size(); i++) {
    if (i) printf(" ");
    printf("%d", ansv[i]);
  }
  printf("\n");
}
