#include <bits/stdc++.h>

#define endl '\n'
#define TRACE(x) cerr << #x << " = " << x << endl

using namespace std;
template<class T, class T1> inline bool chkmax(T &x, const T1 &y) { return x < y ? x = y, true : false; }
template<class T, class T1> inline bool chkmin(T &x, const T1 &y) { return x > y ? x = y, true : false; }

const int MAXN = 7;
const int MAX_SUMS = 21;

int n, n_sums;
int a[MAX_SUMS];

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

int m[MAXN][MAXN];
int seq[MAXN];
int max_seq[MAXN];
bool success = false;

void F(int idx) {
    if (idx == n) {
        int a_ptr = 0;
        for (int i = 0; i < n - 1; i++) {
            for (int j = i + 1; j < n; j++) {
                if (seq[i] + seq[j] != a[a_ptr++]) return;
            }
        }
        if (max_seq[0] == -1) {
            for (int i = 0; i < n; i++) max_seq[i] = seq[i];
        }
        success = true;
        return;
    }
    seq[idx] = m[idx - 1][idx] - seq[idx - 1];
    F(idx + 1);
}

void solve() {
    memset(max_seq, -1, sizeof(max_seq));
    int a_ptr = 0;
    for (int i = 0; i < n - 1; i++) {
        for (int j = i + 1; j < n; j++) m[i][j] = a[a_ptr++];
    }
    int half = a[0] >> 1;
    for (int i = 1; i <= half; i++) {
        seq[0] = i;
        seq[1] = a[0] - i;
        F(2);
        if (success) break;
    }
    cout << 1 << endl;
    for (int i = 0; i < n; i++) cout << max_seq[i] << ' ';
    cout << endl;
}

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

    read();
    solve();

    return EXIT_SUCCESS;
}
