#include <iostream>
using namespace std;

int main(){
    int i, t, j;
    int max[3] = {0};
    int mountain[10] = {0};
    
    for(i = 1; i <= 3; i++){
        for(t = 1; t <= 10; t++){
        cin >> mountain[t];
        if(max[i] < mountain[t]) {
            max[i] = mountain[t];
            }
        }
        
        for(j = 1; j <= 10; j++){
            if(max[i] == mountain[j]) mountain[j] = {0};
        }
        
        cout << max[i] << endl;
    }
    
    
    
    
    

    
    return 0;
    
}