#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:20000000")
using namespace std;
int ri() {
  int x;
  scanf("%d", &x);
  return x;
}
long long rll() {
  long long x;
  scanf("%lld", &x);
  return x;
}
int used[1000500];
void solve() {
  int n = ri();
  for (int i = (int)(1); i <= (int)(n); i++) {
    int x = ri();
    used[x] |= 1;
  }
  int cnt = 0;
  vector<int> ans;
  for (int i = (int)(1); i <= (int)(1000000); i++)
    if (used[i] && used[1000000 + 1 - i])
      cnt++;
    else if (used[i])
      ans.push_back(1000000 + 1 - i);
  for (int i = 1; i <= 1000000 && cnt; i++)
    if (!used[i] && !used[1000000 + 1 - i]) {
      cnt -= 2;
      ans.push_back(i), ans.push_back(1000000 + 1 - i);
    }
  assert(cnt == 0);
  sort(ans.begin(), ans.end());
  cout << ans.size() << endl;
  for (int i = (int)(0); i <= (int)((int)ans.size() - 1); i++)
    printf("%d ", ans[i]);
}
int main() {
  solve();
  return 0;
}
