#include<iostream>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
long long int a[5],fir=-1000000,sec=-1000000,thi=-1000000,fou=-1000000,fif=-1000000;
int main(){
    for(int i=0;i<5;i++){
    cin>>a[i];
    if(a[i]>=fir){
	fif=fou;
	fou=thi;
    thi=sec;
    sec=fir;
    fir=a[i];}else
    if(a[i]>=sec){
	fif=fou;
	fou=thi;
    thi=sec;
    sec=a[i];}else
    if(a[i]>=thi){
	fif=fou;
	fou=thi;
    thi=a[i];}else
    if(a[i]>=fou){
	fif=fou;
    fou=a[i];}else
	{fif=a[i];}
	}
    cout<<fir<<" "<<sec<<" "<<thi<<" "<<fou<<" "<<fif<<endl;

	return 0;}
