#include <bits/stdc++.h>
using namespace std;
const int S = 1000000;
int N;
int a[500005];
bool is[1000006];
vector<int> ans;
int main() {
  scanf(" %d", &N);
  memset(is, false, sizeof(is));
  for (int i = 0; i < N; i++) scanf(" %d", &a[i]), is[a[i]] = true;
  ans.clear();
  int now = N;
  for (int i = 1; i <= S / 2; i++)
    if ((is[i] == true && is[S - i + 1] == false) ||
        (is[i] == false && is[S - i + 1] == true)) {
      if (is[i] == false) ans.push_back(i);
      if (is[S - i + 1] == false) ans.push_back(S - i + 1);
      is[i] = is[S - i + 1] = true;
      now--;
    }
  for (int i = 1; i <= S / 2 && now > 0; i++) {
    if (is[i] == false && is[S - i + 1] == false) {
      now -= 2;
      ans.push_back(i);
      ans.push_back(S - i + 1);
    }
  }
  printf("%d\n", ans.size());
  for (int i = 0; i < ans.size(); i++) {
    if (i == 0)
      printf("%d", ans[i]);
    else
      printf(" %d", ans[i]);
  }
  printf("\n");
  return 0;
}
