const n = require("fs").readFileSync(0, "utf8").toString().split("\n").map(Number);
let max=n[0], idx = 0;
for (let i=1; i<9; i++){
    if(n[i]>max){
        max = n[i];
        idx = i;
    }
}
console.log("%d\n%d",max,idx+1);