STOB - String To Binary


It is an easy problem. You are given a string (without any spaces) and you should find the sum of the string's characters' ASCII value.

You have to remove all duplicate characters from the string.

For example:

SSsssstttrriiinnng = Sstring
HELLO = HELO

Input

The input consists of N<=20 cases. The first line of the input contains only positive integer N. Then follow the cases. Each case consists a string S without any spaces. The length of the S could be around 1000, includind special characters.

Output

For each cases you should print case number and sum of string's ASCII value in binary, and print new line for every test case.

Example

Input:
2
HELLO
SSSPPPOOOJJJ

Output:
#1 : 100101000
#2 : 100111100

hide comments
nadstratosfer: 2018-11-16 22:01:08

78 bytes in Py2.

Last edit: 2018-11-16 22:14:27
prakash: 2016-11-19 19:54:43

pretty easy tutorial problem

antonio_neto: 2016-08-17 16:33:39

even giving equal output is giving WA.I'm ussing C++5.
ps: sorry my english ; ) .

vardan: 2016-08-15 16:23:13

forgot to add (#1 : ) . cost me 3 WA :(

liuxueyang: 2016-07-16 20:15:48

got AC in the first go by PERL. ;-) code length 172 bytes.


Added by:RaYHan
Date:2016-06-12
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64 GOSU JS-MONKEY
Resource:Own Problem