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