#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, x, m = 1000000, count = 0;
  vector<int> ans;
  set<int> s, t;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> x;
    s.insert(x);
  }
  for (int i = 1; i <= m / 2; ++i) {
    if (s.find(i) != s.end()) {
      if (s.find(m + 1 - i) != s.end()) {
        count++;
      } else {
        ans.push_back(m + 1 - i);
      }
    } else {
      if (s.find(m + 1 - i) != s.end()) {
        ans.push_back(i);
      } else {
        t.insert(i);
      }
    }
  }
  cout << ans.size() + 2 * count << '\n';
  for (auto it = ans.begin(); it != ans.end(); ++it) {
    cout << *it << " ";
  }
  auto it = t.begin();
  while (count) {
    cout << *it << " " << m + 1 - *it << " ";
    it++;
    count--;
  }
}
