#include <bits/stdc++.h>
using namespace std;
int n;
int a[1000100];
bool has[1000100], taken[1000100], choose[1000100];
void mark(long long need, bool sign) {
  if (need == 0) {
    choose[0] = sign;
    return;
  }
  long long sum = 0;
  for (int i = 1;; i++)
    if (!taken[i]) {
      sum += i;
      choose[i] = sign;
      if (sum >= need) {
        long long over = sum - need;
        if (!taken[over])
          choose[over] = sign ^ 1;
        else if (over > 0)
          mark(over, sign ^ 1);
        return;
      }
    }
}
int main() {
  scanf("%d", &n);
  long long sumX = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    sumX += (long long)(a[i] - 1);
    has[a[i]] = true;
  }
  for (int i = 0; i <= 1000000; i++)
    if (has[i]) taken[1000000 - i] = true;
  mark(sumX, true);
  int cnt = 0;
  for (int i = 0; i <= 1000000; i++)
    if (choose[i]) cnt++;
  cout << cnt << endl;
  for (int i = 0; i <= 1000000; i++)
    if (choose[i]) cout << 1000000 - i << ' ';
  cout << endl;
}
