#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
bool arr[N];
long long taken = 0;
int n, x, p;
vector<int> ans;
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x;
    arr[x] = 1;
    taken += x - 1;
  }
  for (int i = 1; i <= 1e6; i++) {
    if (arr[i]) {
      if (arr[(int)1e6 - (i - 1)])
        p++;
      else
        ans.push_back(1e6 - (i - 1));
      arr[(int)1e6 - (i - 1)] = 0;
    }
  }
  for (int i = 1; i <= 1e6; i++) {
    if (!p) break;
    if (!arr[i] && !arr[(int)1e6 - (i - 1)])
      ans.push_back(i), ans.push_back(1e6 - (i - 1)), p--;
  }
  cout << ans.size() << endl;
  for (auto i : ans) cout << i << " ";
  return 0;
}
