ans = (0,0) for n in range(5) : s = sum(list(map(int, input().split()))) if ans[1] < s : ans = (n+1, s) print(*ans)