#C7534. Most Popular User

    ID: 51416 Type: Default 1000ms 256MiB

Most Popular User

You are given u users (numbered from 0 to u-1) and p posts. Each post consists of three integers: a user ID, a number of likes, and a number of comments. The popularity of a post is defined as the sum of its likes and comments, i.e., \(\text{popularity} = \text{likes} + \text{comments}\).

Your task is to determine the most popular user by summing the popularity scores of all posts made by each user. In the event of a tie, choose the user with the smallest user ID.

Input/Output Requirements: The problem accepts input through stdin and outputs the result to stdout.

inputFormat

The first line of input contains two integers u and p, where:

  • u is the number of users.
  • p is the number of posts.

This is followed by p lines, each containing three space‐separated integers: the user ID, the number of likes, and the number of comments for a single post.

outputFormat

Output a single integer representing the ID of the most popular user.

## sample
3 5
0 10 15
1 5 10
0 7 3
2 1 1
1 2 0
0