import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner input = new Scanner(System.in);

		int[] 배열 = new int[9];

		for (int i = 0; i < 9; i++) {
			int a = input.nextInt();
			배열[i] = a;
		}

		int max = 배열[0];
		for (int i = 1; i < 배열.length - 1; i++) {
			if (max < 배열[i])
				max = 배열[i];
		}
		System.out.println(max);
		int 위치;
		for (int i = 0; i < 9; i++)
			if (배열[i] == max) {
				위치 = i;
				System.out.println(위치 + 1);
			}

	}

}
