hours = 8 day = 0 for i in range(0,7): time = input().split() work = int(time[0]) + int(time[1]) if work > hours: hours = work day = i + 1 print(day)