import std.stdio;
import std.ascii;
import std.c.stdio;
import std.range;
import std.array;
import std.functional;
import std.algorithm;
import std.conv;
import std.container;
import std.math;
import std.numeric;
import std.string;
import std.c.string;
import std.regex;
import std.typecons;

void main() {
    int N;
    int[] D;
    bool input() {
        scanf("%d\n", &N);
        if (N == 0) return false;
        D = new int[N * (N - 1) / 2];
        foreach (i; 0 .. N * (N - 1) / 2) {
            scanf("%d", &D[i]);
        }
        return true;
    }
    void solve() {
        if (N == 2) {
            writeln(D[0]);
            writeln("-----");
            return;
        }

        int[int] L;
        foreach (i, d; D) {
            L[d]++;
        }
        //writeln("L: ", L);

        int[] splitL(in int[] X, int d) {
            int[] Ret;
            int s = 0, t = 0;
            foreach (i, x; X) {
                t += X[i];
                if (s < d && d < t) {
                    Ret ~= (d - s);
                    Ret ~= (t - d);
                } else {
                    Ret ~= t - s;
                }
                s = t;
            }
            //writeln("split: dir=", dir, ",", "d=", d, ",", X, " -> ", Ret);
            return Ret;
        }

        int[] splitR(in int[] X, int d) {
            auto Y = X.dup;
            reverse(Y);
            auto Ret = splitL(Y, d);
            reverse(Ret);
            return Ret;
        }

        int[][] Ans;
        void dfs(int[] X) {
            int[] s = new int[X.length + 1];
            s[0] = 0;
            foreach (j; 0 .. X.length) {
                s[j + 1] = s[j] + X[j];
            }
            //writeln("dfs(", X, ")");
            int[int] C;
            foreach (j; 0 .. X.length) {
                foreach (k; j + 1 .. X.length + 1) {
                    int p = s[k] - s[j];
                    //writeln([i, j, k]);
                    if (p !in L) return;
                    C[p]++;
                    if (C[p] > L[p]) {
                        return;
                    }
                }
            }

            if (X.length == N - 1) {
                //Ans ~= format("%(%s %)", X);
                Ans ~= X;
                return;
            }
            foreach (j, d; D) {
                if (d !in C || C[d] < L[d]) {
                    //writeln(d);
                    auto nX = splitR(X, d);
                    if (nX != X) dfs(nX);
                    nX = splitL(X, d);
                    if (nX != X) dfs(nX);
                    break;
                }
            }
        }

        dfs([D[0]]);
        if (!Ans.empty) {
            Ans.sort;
            Ans = Ans.uniq.array;
            foreach (A; Ans) {
                writefln("%(%s %)", A);
            }
        }
        writeln("-----");
    }
    while (input) solve;
}