#include <iostream>
#include <algorithm>
using namespace std;
int main(int argc, const char* argv[]) {
int arr[9];
int arr2[9];
int max;
int index;
ios_base::sync_with_stdio(0);
for (int i = 0; i <= 8; i++) {
cin >> arr[i];
arr2[i] = arr[i];
}
sort(arr, arr + 9);
for (int i = 0; i <= 8; i++) {
if (arr[8] == arr2[i]) {
index = i+1;
}
}
cout << arr[8] << "\n";
cout << index;
return 0;
}
sort() ํจ์ ์ฐธ๊ณ