#include <bits/stdc++.h>
using namespace std;
bool flag[1111111];
int main() {
  const int m = 1000000;
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    flag[x] = true;
  }
  vector<int> ans, tmp;
  int cnt = 0;
  for (int i = 1; i * 2 <= m; i++) {
    int j = m + 1 - i;
    if (flag[i] && flag[j]) cnt++;
    if (flag[i] && !flag[j]) ans.push_back(j);
    if (!flag[i] && flag[j]) ans.push_back(i);
    if (!flag[i] && !flag[j]) tmp.push_back(i);
  }
  for (int i = 0; i < cnt; i++) {
    ans.push_back(tmp[i]);
    ans.push_back(m + 1 - tmp[i]);
  }
  printf("%d\n", ans.size());
  for (int i = 0; i < ans.size(); i++) printf("%d ", ans[i]);
  return 0;
}
