#include <bits/stdc++.h>
using namespace std;
int inX[1000001] = {0};
int used[1000001] = {0};
vector<int> ans;
int main() {
  int n;
  scanf("%d", &n);
  vector<int> given(n, 0);
  for (int i = 0; i < n; i++) {
    scanf("%d", &given[i]);
    inX[given[i]] = 1;
    used[given[i]] = 1;
  }
  vector<int> pairLeft;
  int reqdPairs = 0;
  for (int i = 1; i <= 1000000; i++) {
    if (inX[i]) {
      if (inX[1000000 + 1 - i] == 0) {
        used[1000000 + 1 - i] = 1;
        ans.push_back(1000000 + 1 - i);
      } else {
        reqdPairs += 1;
      }
    } else {
      if (inX[i] == inX[1000000 + 1 - i]) pairLeft.push_back(i);
    }
  }
  for (int i = 0; 2 * i < reqdPairs; i++) {
    ans.push_back(pairLeft[i]);
    ans.push_back(1000000 + 1 - pairLeft[i]);
  }
  printf("%d\n", (int)ans.size());
  for (int i = 0; i < (int)ans.size(); i++) printf("%d ", ans[i]);
  return 0;
}
