#include <iostream>
using namespace std;

int main()
{
  int high;
  int temp1,temp2;
  int first=0,second=0,third=0;
  
  for(int i=0;i<10;i++){
    cout<<"山の高さ"<<i<<":";
    cin>>high;
    if(high>first){
      temp1=first;
      first=high;
      temp2=second;
      second=temp1;
      third=temp2;
    } else if (first>high && high>second){
      temp2=second;
      second=high;
      third=temp2;
    } else if (second>high && high>third){
      third=high;
    }
  }

  cout<<"1番目に高い山の高さ:"<<first<<endl;
  cout<<"2番目に高い山の高さ:"<<second<<endl;
  cout<<"3番目に高い山の高さ:"<<third<<endl;
  
  return 0;
}

