#T518. 【NOIP2004-J1】不高兴的津津

【NOIP2004-J1】不高兴的津津

Description

Jinjin has entered middle school. Her mother believes she should study harder, so in addition to regular school, Jinjin attends various review classes arranged by her mother. Furthermore, every week, her mother sends her to recitation, dance, and piano lessons. However, if Jinjin's daily class hours exceed eight, she becomes unhappy, and the longer the class hours, the unhappier she gets. Assume Jinjin won't be unhappy for other reasons, and her unhappiness doesn't carry over to the next day. Please help check Jinjin's schedule for the upcoming week to see if she will be unhappy; if so, determine on which day she will be the most unhappy.

Input Format

The input consists of seven lines of data, representing the schedule from Monday to Sunday. Each line contains two non-negative integers less than 10, separated by a space, indicating the hours Jinjin spends in school and the hours arranged by her mother for additional classes, respectively.

Output Format

The output consists of a single line containing one number. If Jinjin won't be unhappy, output 0. If she will be unhappy, output the day of the week (represented by 1, 2, 3, 4, 5, 6, 7 for Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday) when she is the most unhappy. If two or more days have the same level of unhappiness, output the earliest day.

```input1 5 3 6 2 7 2 5 3 5 4 0 4 0 6 ``` ```output1 3 ``` ## Translation

NOIP2004-J1

(Note: Since the original text is just an identifier/code "NOIP2004-J1" which is already in English format, the translation remains identical. NOIP stands for National Olympiad in Informatics in Provinces, a Chinese programming competition for secondary school students.)