#include<iostream>
using namespace std;

int main(){
    int a = 0, b = 0, c = 0, d = 0, e = 0, poi[5];
    for(int i = 0;i < 5;++i) cin >> poi[i]; 
    for(int j = 0;j < 5;++j){
       if(poi[j] > a){
        e = d;
        d = c;
        c = b;
        b = a;
        a = poi[j];
        }
       else if(poi[j] > b){
        e = d;
        d = c;
        c = b;
        b = poi[j];
        }
       else if(poi[j] > c){
        e = d;
        d = c;
        c = poi[j];
        }
       else if(poi[j] > d){
        e = d;
        d = poi[j];
        }  
       else d = poi[j];
    } 
    cout << a << " " << b << " " << c << " " << d << " " << e << endl;
    return 0;
}