Problems
10129 - Password
SUBMIT PROBLEM

Password

Time Limit: 1 sec

 

The Problem

Many years ago there was an island named as wowland. Many minions lived in that island. In this wowland every minions had a strange name. Because the name contains same alphabets such as DD, HHHH, FFFFF. This name was very important for a minion to survive in the wowland. In this wowland everything  runs in a unique system. In thit land to buy anything, ride in anything, communicate with anyone every minion needed an ID card. This ID card contains the name of the user and a password. This password is generated from the user name in a sequential way. So the name of minions must be unique from other, which means the name of a minion can’t be used by other minion. If one minion dies then his name can usable for another minion. The way in which password made from user name is given below.

 

User Name>>

A

B

………...

Z

AA

………...

ZZ

AAA

…………….

Password>>

1

2

………...

26

27

………...

52

53

…………….

 

Now your task is to find the password from a name.

 

The Input

The input file will contain several lines of input. Each line of the input will contain a single string input S which is the name of the minion. The given name is not case sensitive so g and G is considered as same. The lengths of a name will not greater 100001. A single # will indicate the end of the input.

 

The Output

For each line of input print “Case C# R”. Where C is the case number starting from 1 and R is the password for the given name.

 

Sample Input

aa

mm

TT

B

#

 

Sample Output

Case 1# 27

Case 2# 39

Case 3# 46

Case 4# 2

 

 

 

[Outsbook Round #1 Online Contest]

Problem Setter: Milton Deb