func_code_string: #include <bits/stdc++.h>   using namespace std;   long long min(long long x, long long y) { return (x < y) ? x : y; }   long long max(long long x, long long y) { return (x > y) ? x : y; }   const int N = 1000009;   const int E = 1000000;   int x, y, n, m, e, i, u, w, mx, z, sum, l, r, best, cnt, g, j, k, t;   int a[N], flag[N], mark[N];   string s;   vector<int> pos, ans;   int main() {     cin >> n;     for (int i = 0; i < n; i++) {       cin >> a[i];       flag[a[i]] = true;     }     for (int i = 1; i <= E / 2; i++)       if (!flag[i] && !flag[E - i + 1]) pos.push_back(i);     for (int i = 0; i < n; i++) {       if (mark[a[i]]) continue;       mark[a[i]] = true;       k = a[i];       if (!flag[E - k + 1])         ans.push_back(E - k + 1);       else {         w = pos[cnt];         cnt++;         ans.push_back(w);         ans.push_back(E - w + 1);         mark[E - k + 1] = true;       }     }     cout << ans.size() << endl;     for (int i = 0; i < ans.size(); i++) cout << ans[i] <<    ;     return 0;   }   