eolymp
bolt
Try our new interface for solving problems
Problems

Turtle

Turtle

In the castle hall of the miracles a rectangular floor is covered with tiles, and on each tile there are berries. The tortoise should get from the upper row of tiles to the bottom and wants to eat the most berries along the way. It can only move from the top row to the lower row and only along the paths indicated in the figure. Help the turtle to determine the tile in the upper row, from which, after reaching the bottom row, it will eat as many berries as possible. If there are several such tiles in the upper row, indicate the leftmost tile.

prb8360.gif

Input

The first line contains two integers n and m (1n, m1000) - the number of rows and columns in rectangular floor. Each of the next n lines contains m positive integers - the number of berries on corresponding tile.

Output

Print in one line the number of the tile in the upper row (numbering with 1), with which you must start to move the turtle to eat the maximum number of berries, and the number of berries that it will eat.

Time limit 1 second
Memory limit 128 MiB
Input example #1
4 5
3 4 1 1 3
2 2 1 2 4
5 4 1 2 3
2 9 5 4 8
Output example #1
2 20
Source 2018 Azerbaijan School Competition, II Stage, April 8, Problem L