public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = 0, cnt = 1;
        HDOJ1069 hdoj1069 = new HDOJ1069();
        while ((n = scanner.nextInt()) > 0) {
            hdoj1069.init();
            while (n-- > 0) {
                hdoj1069.handleInput(scanner.nextInt(), scanner.nextInt(), scanner.nextInt());
            }
            System.out.println(String.format("Case %s: maximum height = %s", cnt++, hdoj1069.entrance()));
        }
    }