Problem Description
Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they are sending their messages in a number format. This format represents the way that numbers and characters are padded on mobile’s keypad. One smuggler sends a text message to the second smuggler, using the numbers corresponding to the letters on the keypad. When the receiving smuggler gets the message, he simply opens the “create text message” function in his mobile and types the number string. This way the receiver finally reads the original message. For Example: - 6999066263304447777077766622337778 -----> message sent by the first smuggler. my name is robert---------> message decoded by the second smuggler. Where ‘0’ denotes the "space".
Explanation: By pressing ‘6’ (i.e. key’6’ one time) on the keypad, the mobile shows ‘m’ on display screen in write text message area. By pressing ‘999’ (i.e. key ‘9’ three times) on the keypad, the mobile shows ‘y’ on display screen in write text message area. By pressing ‘0’ (i.e. key ’0’ one time) on the keypad, the mobile shows ‘space’ on display screen in write text message area. By pressing ‘66’ (i.e. key’6’ two times) on the keypad, the mobile shows ‘n’ on display screen in write text message area. By pressing ‘2’ (i.e. key ’2’ one time) on the keypad, the mobile shows ‘a’ on display screen in write text message area. By pressing ‘6’ (i.e. key ''6''one time) on the keypad, the mobile shows ‘m’ on display screen in write text message area. By pressing ‘33’ (i.e. key ‘3’ two times) on the keypad, the mobile shows ‘e’ on display screen in write text message area. By pressing ‘0’ (i.e. key ‘0’ one time) on the keypad, the mobile shows ‘space’ on display screen in write text message area. By pressing ‘444’ (i.e. key’4’ three times) on the keypad, the mobile shows ‘i’ on display screen in write text message area. By pressing ‘7777’ (i.e. key ’7’ four times) on the keypad, the mobile shows ‘s’ on display screen in write text message area. By pressing ‘0’ (i.e. key ‘0’ one time) on the keypad, the mobile shows ‘space’ on display screen in write text message area. By pressing ‘777’ (i.e. key ’7’ three times) on the keypad, the mobile shows ‘r’ on display screen in write text message area. By pressing ‘666’ (i.e. key ’6’ three times) on the keypad, the mobile shows ‘o’ on display screen in write text message area. By pressing ‘22’ (i.e. key ‘2’ two times) on the keypad, the mobile shows ‘b’ on display screen in write text message area. By pressing ‘33’ (i.e. key ‘3’ two times) on the keypad, the mobile shows ‘e’ on display screen in write text message area. By pressing ‘777’ (i.e. key ’7’ three times) on the keypad, the mobile shows ‘r’ on display screen in write text message area. By pressing ''8'' (i.e. key ’8’ one time) on the keypad, the mobile shows ‘t’ on display screen in write text message area.
But for word monkey 6#666#665533999 this string will be sent by the smuggler one Here ‘# ‘ denotes that if smuggler watches ‘#’ then it means character previous to # is on the same key to the character after the ‘#’ and smuggler has to wait for 2 seconds and then press the same key.
Explanation: By pressing ‘6’ i.e. key’6’ one time on the keypad, the mobile shows ‘m’ on display screen. For ''#'' wait for 2 seconds, and then press next. By pressing ‘666’ i.e. key’6’ three times on the keypad, the mobile shows ‘o’ on display screen. For ‘#’ wait for 2 seconds, and then press next. By pressing ‘66’ i.e. key’6’ two times on the keypad, the mobile shows ‘n’ on display screen. By pressing ‘55’ i.e. key’5’ two times on the keypad, the mobile shows ‘k’ on display screen. By pressing ‘33’ i.e. key’3’ two times on the keypad, the mobile shows ‘e’ on display screen. By pressing ‘999’ i.e. key’9’ three times on the keypad, the mobile shows ‘y’ on display screen.
*Here lower case doesn’t matter. *Assuming that the smuggler one will not send any numeral characters in the original message. For example smuggler will not send any message like "I need 1000 bucks" as it contains numerals. So policemen need your help to track the smugglers. You have to write a program that decodes the sending smuggler’s string (from the number format into plain text).