#C2108. Alphabetical Ranks

    ID: 45388 Type: Default 1000ms 256MiB

Alphabetical Ranks

Alphabetical Ranks

Given a string consisting only of lowercase alphabets, compute the alphabetical rank of each character based on its position in the English alphabet. The rank of a character \(c\) is computed as:

\(rank(c) = ord(c) - ord('a') + 1\)

For example, the rank of 'a' is 1, 'b' is 2, and so on until 'z' which is 26.

Read the input string from standard input and output the respective ranks separated by a space on a single line.

inputFormat

Input consists of a single line containing a non-empty string of lowercase alphabets.

outputFormat

Output the alphabetical rank of each character in the string, with each rank separated by a space.## sample

abcd
1 2 3 4