#T721. 【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 remedial classes arranged by her mother. Furthermore, every week, her mother sends her to learn recitation, dance, and piano. However, Jinjin becomes unhappy if her daily class hours exceed eight, and the longer the hours, the more unhappy she becomes. 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 next week to see if she will be unhappy; if so, determine on which day she will be 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 (using 1, 2, 3, 4, 5, 6, 7 to represent Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday) when she is most unhappy. If two or more days have the same level of unhappiness, output the earliest day among them.

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

NOIP2004-J1