#define _CRT_SECURE_NO_WARNINGS
#define _SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING

#include <bits/stdc++.h>

using namespace std;

int main() {
    multiset<int> S;
    int n, m;
    while (~scanf("%d", &m)) {
        n = sqrt(8 * m + 1) / 2;
        S.clear();
        for (int i = 0, x; i < m; i++) scanf("%d", &x), S.insert(x);
        vector<int> ans(n);
        for (int i = 0; i < n; i++) {
            ans[i] = *S.begin();
            for (int j = 0; j < i; j++)
                S.erase(S.find(ans[j] + ans[i]));
            S.erase(S.find(ans[i]));
        }
        printf("%d\n", n);
        for (int i = 0; i < ans.size(); i++)
            printf("%d%c", ans[i], " \n"[i == ans.size() - 1]);
    }
    return 0;
}
