#include using namespace std; int main(){ int List[100]; int number, first; cin >> number; for(int i = 0; i < number; i++) cin >> List[i]; first = second = List[0]; for(int i = 1; i <= number; i++) if(List[i] >= first){ second = first; first = List[i]; } else if (List[i] >= second) second = List[i] cout << first << " " << second << endl; return EXIT_SUCCESS; }