This page is still under construction.

Parts of this page are still being built. What you see may change.

Hidden Words

Interview

Time limit2sMemory limit1024 MB

Summary
Starting from the first character, each letter tells how many positions ahead the next character is; output every visited character.
Level

Easy2 of 10

Topics
String, Simulation, Implementation
Solved
No attempts yet

Problem

Anna sends secret encrypted messages to Bert. To read the messages, Bert must decrypt them with the following algorithm:

  • The first character of the input string is included in the output string.
  • Each character that is included states where in the input string the next character to include is found. An 'A' means the next character is 1 position ahead, a 'B' means 2 positions ahead, and so on.
  • When the last character of the input is reached, that character is included and the process is done. The input is such that the last character is always reached.

Help Bert by writing a program that decrypts Anna's messages.

Input

The first and only line of the input contains the encrypted string (at most 50 characters). The string can be decrypted with the algorithm described above without going past the last character.

Output

Print the decrypted string.

Examples2

  1. Example 1

    Input
    ABKBFA
    
    Expected output
    ABBA
    
  2. Example 2

    Input
    HZBKRYAFEAAAAJ
    
    Expected output
    HEJ