
#include <iostream>
#include <set>
#include <cstdlib>
#include <cstring>
using namespace std;

bool contain(int* a, int b) {
for (int i=0; i<10; i++)
    if(a[i] == b) return true;

return false;
}

int compare (const void * a, const void * b)
{
  return ( *(int*)a - *(int*)b );
}

bool mymemcmp(int *a, int *b, int siz) {
for(int i=0; i < siz; i++)
if(a[i] != b[i]) return false;

    return true;
}

int main()
{
int bb=0;
int tab[10];
for(int i =0; i < 10; i++)
    cin >> tab[i];

qsort(tab,10,sizeof(int),compare);

for( int i0=2; i0 < 4999; i0++)
for( int i1=2; i1 < 4999; i1++)
{
if(contain(tab,i0+i1))
for( int i2=2; i2 < 4999; i2++)
{
if(contain(tab,i1+i2))
if(contain(tab,i0+i2))
for( int i3=2; i3 < 4999; i3++)
{
if(contain(tab,i1+i3))
if(contain(tab,i2+i3))
for( int i4=2; i4 < 4999; i4++){
if(contain(tab, i0 + i4))
if(contain(tab, i1 + i4))
if(contain(tab, i2 + i4))
if(contain(tab, i3 + i4))
   {
       int* newtab = new int[10];
    newtab[0] = i0+i4;
    newtab[1] = i1+i4;
    newtab[2] = i2+i4;
    newtab[3] = i3+i4;
    newtab[4] = i2+i3;
    newtab[5] = i1+i3;
    newtab[6] = i0+i3;
    newtab[7] = i0+i2;
    newtab[8] = i1+i2;
    newtab[9] = i0+i1;
    qsort(newtab,10, sizeof(int), compare);
    if(mymemcmp(newtab,tab,10)) {
        cout << i0 << endl;
        cout << i1 << endl;
        cout << i2 << endl;
        cout << i3 << endl;
        cout << i4 << endl;
        goto out;
    }
    delete newtab;
   }

}
}
}
}
out:

return 0;
}

