#K12336. Most Active User
Most Active User
Most Active User
You are given a list of users and a list of their interactions. Each user has a unique ID and a name. An interaction is initiated by one user (the sender) and directed to another user. Your task is to determine the most active user, i.e., the user who initiated the largest number of interactions.
If there is a tie between two or more users, choose the user who appears first in the input list.
You can mathematically express the number of interactions initiated by a user \(u\) as follows:
[ f(u)=\text{number of interactions initiated by } u ]
inputFormat
The input is given from standard input (stdin) in the following format:
- The first line contains an integer \(N\), indicating the number of users.
- The next \(N\) lines each contain an integer and a string separated by space, representing the user ID and the user name respectively.
- The following line contains an integer \(M\), indicating the number of interactions.
- The next \(M\) lines each contain two integers and a string separated by space: the sender's user ID, the receiver's user ID, and the interaction type.
outputFormat
Output a single line to standard output (stdout) containing the name of the most active user.
## sample3
1 Alice
2 Bob
3 Charlie
4
1 2 like
2 1 comment
1 3 follow
1 2 like
Alice
</p>