#include <iostream>
#include <string>
#include <cassert>
#include <utility>

struct translator
{
    translator(std::string src, std::string tgt) 
        : _source(std::move(src)), _target(std::move(tgt)) 
    {
        assert(_source.length() == _target.length());
    }


    char operator()(char ch) const;

private:
    std::string _source;
    std::string _target;
};


// if ch is found in _source, return the corresponding character in _target
// if it isn't found in _source, return ch
char translator::operator()(char ch) const
{
    auto pos = _source.find(ch);
    return pos == std::string::npos ? ch : _target[pos];
}

// helper function.  Applies translator to every element in a string.
std::string translate(const translator& xlate, std::string s)
{
    for (auto& ch : s)
        ch = xlate(ch);

    return s;
}


int main()
{
    translator xlator("0123456789", "ABCDEFGHIJ");

    std::string line;

    while (std::getline(std::cin, line) && !line.empty())
        std::cout << translate(xlator, line) << '\n';
}