#A111. An easy problem

An easy problem

Problem Description

We define $\\ f(A) = 1, \\ f(a) = -1, \\ f(B) = 2, \\ f(b) = -2, \\ \vdots \\f(Z) = 26, \\ f(z) = -26$;

Give you a letter xx and a number yy , you should output the result of f(x)+yf(x)+y.

Input

On the first line, contains a number TT, then TT lines follow, each line is a case. Each case contains a letter xx and a number yy.

Output

for each case, you should the result of f(x)+yf(x)+y on a line.

Samples

6
R 1
P 2
G 3
r 1
p 2
g 3
19
18
10
-17
-14
-4