#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <map>
#define pb push_back
#define mp make_pair
#define ll long long
using namespace std;
const int N = 5e3 + 5;
const int MAX_SUM = 205;

int n, m;
int sm[N * N];

int ans;
vector <int> ans_seq;

map <int, int> have;
bool check(int x)
{
    vector <int> seq;
    seq.pb(x);

    have.clear();
    for(int i = 1; i <= m; i++)
        have[sm[i]]++;

    for(int id = 0; id < seq.size(); id++)
    {
        for(auto t: have)
        {
            int i = t.first;
            while(have[i])
            {
                seq.pb(i - seq[id]);
                for(int j = (int)seq.size() - 2; j >= 0; j--)
                {
                    if(have[i - seq[id] + seq[j]] == 0)
                        return false;
                    have[i - seq[id] + seq[j]]--;
                }
            }
        }
    }

   for(auto t: have)
        if(t.second)
            return false;
    ans_seq = seq;
    return true;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);

    cin >> n;
    m = n * (n - 1) / 2;
    for(int i = 1; i <= m; i++)
        cin >> sm[i];

    sort(sm + 1, sm + m + 1);
    for(int i = sm[1] / 2; i >= 1; i--)
    {
        if(check(i))
            ans++;
    }

    cout << ans << endl;
    for(auto x: ans_seq)
        cout << x << " ";
    cout << endl;

    return 0;
}

/*

3
3 4 5

4
7 10 11 12 13 16

*/
