#include <iostream>
#include <sstream>
#include <string>

using namespace std;

int main(){
    const std::string data =
        "A gentle, dull flickering flame, burns in the marble hearth. "
        "Its dim light scarcely illuminates the small, cozy room with its "
        "figure of a wooden desk at which Allen was roaming through his "
        "memories. Thinking back in the past where he once had a "
        "friendship which was out righteously incredible. She was the "
        "girl of his dreams, in a way which she had everything he had "
        "ever sought out in a beautiful and clever girl. Most of all she "
        "had his heart. Her style was incredible in the way the outfits "
        "she would wear would match perfectly giving a deep vibrant lively feeling.";

    char choice;
    const char decrypt = 'd';
    const char encrypt = 'e';


    while (std::cin >> choice && (choice == decrypt || choice == encrypt))
    {
        if (choice == decrypt)
        {
            // consume any leading whitespace:
            std::cin >> std::ws;

            // read in the line of text that contains the code to decrypt.
            std::string line;
            std::getline(std::cin, line);

            // convert the line into a stream:
            std::istringstream code_stream(line);

            int code;
            // while stream extraction is successful,
            while (code_stream >> code)
                std::cout << data[code];    // output the decrypted character.

        }
        else
            std::cout << "Unimplemented";

        std::cout << std::endl;
    }
}