Another word sorting#2541

Another word sorting

1 second
64 megabytes
Very easy

A new scoring system for words has been invented and is described as follows. Each letter has a value according to its position in the alphabet, e.g. a = 1, b = 2, c = 3, , z = 26. The score of a word is the sum of the values of its letters plus bonuses. If a word contains double letters (two consecutive identical letters), it gets a bonus equal to times the value of that letter. See the examples below:

\text{apple} = (1 + 16 + 16 + 12 + 5) + \text{bonus } 2 \times 16 = 82

\text{banana} = (2 + 1 + 14 + 1 + 14 + 1) = 33 \ (\text{no bonus})

\text{orange} = 15 + 18 + 1 + 14 + 7 + 5 = 60 \ (\text{no bonus})

\text{acted} = (1 + 3 + 20 + 5 + 4) = 33 \ (\text{no bonus})

\text{commit} = 3 + 15 + 13 + 13 + 9 + 20 + \text{bonus } 13 \times 2 = 99

A letter can be used to calculate the bonus only once per word.

Given a list of words, rearrange them in descending order of their scores. In case of equal scores, sort the words lexicographically.

Input

The input contains a sequence of words, one per line. Each word contains only lowercase letters () and has at most letters. The input may contain up to lines.

Output

The output contains the sequence of input words rearranged as described. Each line contains a single word. If there are duplicates, all occurrences must be preserved. There must be no spaces or blank lines in the output.

Examples

Example 1

Loading
Loading