Santa and Hats

View as PDF

Submit solution

Points: 3
Time limit: 1.0s
Memory limit: 64M

Problem type

Every year, Santa is indecisive about which of his two hats he will wear when delivering presents on Christmas.

This year, Santa has ranked both his hats in two categories: style and practicality. He scores his first hat A_1 in style and B_1 in practicality and his second hat A_2 in style and B_2 in practicality.

Santa thinks that the hat he should wear is the one that has strictly more style and more practicality than the other. If neither of the two hats satisfies this condition, he decides that he should go with the first hat.

Santa wants you to find out which hat he should wear on Christmas.

Input Specification

The first line will contain two space-separated integers, A_1 and B_1 (1 \le A_1, B_1 \le 10^3).

The second line will contain two space-separated integers, A_2 and B_2 (1 \le A_2, B_2 \le 10^3).

Output Specification

Output one line containing Hat 1 if Santa should wear the first hat or Hat 2 if he should wear the second.

Sample Input 1

3 7
4 10

Sample Output 1

Hat 2

Sample Input 2

1 10
5 6

Sample Output 2

Hat 1


There are no comments at the moment.