import java.io.*;
import java.util.ArrayList;
import java.util.List;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
List<Integer> list = new ArrayList<>();
for(int i = 0 ; i < 9 ; i++){
list.add( Integer.parseInt( br.readLine() ) );
}
int max = list.get(0);
for(int j = 1; j < list.size(); j++){
if( max < list.get(j)){
max = list.get(j);
}
}
int index = list.indexOf(max) + 1;
bw.write(String.valueOf(max));
bw.newLine();
bw.write(String.valueOf(index));
bw.flush();
bw.close();
}
}