Strategy Game

Distribute J times R point values to players in turn order, sum each player's points, and find the highest scorer, breaking ties by last move.

Easy3ArraySimulationInterviewNo attempts yetTime limit1sMemory limit512 MB

Problem

A strategy game with J players is played around a table. Player 1 moves first, player 2 moves second, and the order continues up to player J. Once a round is complete, player 1 moves again and the same order repeats. Every move earns the player some victory points, and a player's score is the sum of the victory points from all of that player's moves.

You are given the number of players, the number of rounds, and a list of the victory points in the order they were earned. Determine which player wins. If more than one player reaches the maximum score, the winner is the one among them who moved last.

Input

The first line contains two integers J and R, the number of players and the number of rounds (1J,R5001 \le J, R \le 500).

The second line contains J×RJ \times R integers, the victory points earned on each move, in the order the moves happened. The victory points earned on a move are always an integer between 0 and 100, inclusive.

Output

Print one line containing the number of the winning player.