#K5701. Resource with Highest Value

    ID: 30325 Type: Default 1000ms 256MiB

Resource with Highest Value

Resource with Highest Value

You are given n resource strings. Each string consists of uppercase English letters. The value of a resource string s is defined by the formula: \( V(s) = \sum_{i=1}^{|s|} (s_i - 'A' + 1) \), where \( s_i \) denotes the \( i^{th} \) character of s.

Your task is to select the resource string with the highest value. In the event of a tie (i.e. several strings have the same maximum value), output the lexicographically smallest string among them.

Note: An empty string has a value of 0.

inputFormat

The first line contains an integer n representing the number of resource strings.

The following n lines each contain a resource string. These strings consist only of uppercase English letters (or may be empty).

outputFormat

Output a single line containing the resource string with the highest value. If there are multiple answers, output the lexicographically smallest one.

## sample
4
ABCDE
XYZ
HELLO
WORLD
XYZ

</p>