#include <iostream>
#include <iomanip>

using namespace std;

int main(int argc, char * argv[])
{
    int n = 12;
    int * v = new int[n];
    for(int i = 0; i < n; ++i)
    {
        int d = rand()%20;
        cout << setw(6) << d;
        v[i] = d;
    }
    cout << endl;
    
    for(int i = 0; i < n-1; ++i)
    {
        for(int j = i+1; j < n; ++j) cout << setw(6) << (v[j] -= v[i]);
        cout << endl;
    }
    
}

