#include <bits/stdc++.h>
using namespace std;
bool belum[1111111];
int num[1111111];
int opp(int x) { return 1000001 - x; }
int main() {
  int N;
  memset(belum, 0, sizeof(belum));
  scanf("%d", &N);
  for (int i = (0); i < (N); ++i) scanf("%d", &num[i]), belum[num[i]] = 1;
  vector<int> ans;
  int cnt = 0;
  for (int i = (0); i < (N); ++i) {
    if (belum[opp(num[i])] == 0) {
      ans.push_back(opp(num[i]));
      belum[opp(num[i])] = 1;
    } else
      cnt++;
  }
  for (int i = (1); i <= (500000); ++i) {
    if (cnt && belum[i] == 0 && belum[opp(i)] == 0) {
      ans.push_back(i);
      ans.push_back(opp(i));
      belum[i] = belum[opp(i)] = 1;
      cnt -= 2;
    }
  }
  sort(ans.begin(), ans.end());
  cout << ans.size() << endl;
  for (int i = (0); i < (ans.size()); ++i)
    if (ans.size() - 1 == i)
      printf("%d\n", ans[i]);
    else
      printf("%d ", ans[i]);
  return 0;
}
