#include <bits/stdc++.h>
#define endl '\n'

#define SZ(x) ((int)x.size())
#define ALL(V) V.begin(), V.end()
#define L_B lower_bound
#define U_B upper_bound
#define pb push_back

using namespace std;
template<class T, class T1> int chkmin(T &x, const T1 &y) { return x > y ? x = y, 1 : 0; }
template<class T, class T1> int chkmax(T &x, const T1 &y) { return x < y ? x = y, 1 : 0; }
const int MAXN = 542;

int n, L;
int a[MAXN * MAXN];

void read()
{
    cin >> n;
    for(int i = 0; i < n * (n - 1) / 2; i++)
        cin >> a[i];

    L = n * (n - 1) / 2;
}

int ans[MAXN];
map<int, int> used;

bool check(int x)
{
    used.clear();
    for(int i = 0; i < L; i++)
        used[a[i]]++;

    ans[0] = x;
    
    int pos = 0;
    for(int i = 1; i < n; i++)
    {
        while(pos < L && used[a[pos]] == 0) pos++;
        
        if(pos == L) return false;
        ans[i] = a[pos] - x;
    
        for(int j = 0; j < i; j++)
            if(!used[ans[i] + ans[j]])
                return false;
            else
                used[ans[i] + ans[j]]--;
    }

    return true;
}

void solve()
{
    int low = 1, high = a[0] / 2, cnt = 0, frst = (int) 1e9;
    int qq = -1;
    for(; high >= low; high--)
        if(check(high))
        {
            chkmin(frst, high);
            cnt++;
        }
        else 
        {
            if(qq == -1) chkmax(low, high - 200);
            qq = 1;
        }
    
    check(frst);
    cout << cnt << endl;
    for(int i = 0; i < n; i++)
        cout << ans[i] << " ";
    cout << endl;
}

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

    read();
    solve();
    return 0;
}
