#include <bits/stdc++.h>
using namespace std;
int n;
bool flag[1000010];
vector<int> v;
int main() {
  int t;
  while (~scanf("%d", &n)) {
    for (int i = 0; i < n; i++) {
      scanf("%d", &t);
      flag[t] = 1;
    }
    int cnt = 0;
    for (int i = 1; i < 1000000 + 1 - i; i++) {
      int re = 1000000 + 1 - i;
      if (flag[i]) {
        if (!flag[re]) {
          v.push_back(re);
          flag[re] = 1;
        } else {
          cnt++;
        }
      } else {
        if (flag[re]) {
          v.push_back(i);
          flag[i] = 1;
        }
      }
    }
    for (int i = 1; i < 1000000 + 1 - i; i++) {
      int re = 1000000 + 1 - i;
      if (!cnt) {
        break;
      }
      if (!flag[i] && !flag[re]) {
        v.push_back(i);
        v.push_back(re);
        cnt--;
      }
    }
    printf("%d\n", v.size());
    for (int i = 0; i < v.size(); i++) {
      printf("%d ", v[i]);
    }
  }
  return 0;
}
