Given a grid with uppercase letters, compute the sum of the values of
the letters in each rectangle with a corner in the upper-left extreme.
The values of the letters are
’A’,
’B’,
’C’,
’D’,
etcetera, up to
’Z’.
Input consists of lines, all of them with the same number of uppercase letters .
Print lines with numbers each. The -th number of the -th row must be the sum of the values of the letters of the rectangle whose corners are the first letter of the input, and the -th letter of the -th row.
Consider using the inclusion-exclusion principle.
Input
ZA AZ
Output
351 352 352 704
Input
ABCD EFGH IJKL
Output
1 4 10 20 16 40 74 120 61 140 240 364