#include <bits/stdc++.h>
using namespace std;
const int MAX = 1000000 + 10;
int s = 1e6;
int n, first[MAX];
int ans[MAX];
int main() {
  int i;
  scanf("%d", &n);
  for ((i) = (1); (i) <= (n); ++(i)) {
    scanf("%d", &first[i]);
    ans[first[i]]++;
  }
  vector<int> answer;
  int need = 0;
  for ((i) = (1); (i) <= (s); ++(i))
    if (ans[i] && !ans[s + 1 - i]) answer.push_back(s + 1 - i);
  for ((i) = (1); (i) <= (s / 2); ++(i))
    if (ans[i] && ans[s + 1 - i]) ++need;
  cout << answer.size() + need * 2 << endl;
  for ((i) = (0); (i) != ((int)answer.size()); ++(i)) printf("%d ", answer[i]);
  for ((i) = (1); (i) <= (s / 2); ++(i))
    if (!ans[i] && !ans[s + 1 - i] && need) {
      printf("%d %d ", i, s + 1 - i);
      need--;
    }
  return 0;
}
