#Lutece0228. Name PK
Name PK
Migrated from Lutece 228 Name PK
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
Name PK is a funny game on the Internet. The game will calculate a person's characteristic according to his name.
Now we're simulating a simple Name PK game. Each person has a parameter attacking
which represents his ability to attack others.
For a name with length , is the -th letter of the name.
We define . Suppose is a lowercase letter, and is the ordinal rank of in the alphabet. For example a
, b
, and so on…
Now you will be given two names, your task is to calculate their attacking ability and tell me who will win.
Input
The input consists of several test cases. The first line is an integer , indicating the number of test cases. Each test case is on a separate line, including two strings separated by a whitespace, indicating the name of each person.
Each name contains only lowercase letters in English with the length between and .
Output
For each case, output two lines. In the first line, please report the attacking ability of each person respectively, remaining the same order as the input. In the second line, output the result of the first person:1win
, lose
or tie
.
Samples
1
dalong chiara
14 46
lose