
def encoding(c):
    if c == 'a':
        c1 = 'd'
    elif c == 'b':
        c1 = 'e'
    elif c == 'c':
        c1 = 'f'
    elif c == 'd':
        c1 = 'g'
    elif c == 'e':
        c1 = 'h'
    elif c == 'f':
        c1 = 'i'
    elif c == 'g':
        c1 = 'j'
    elif c == 'h':
        c1 = 'k'
    elif c == 'i':
        c1 = 'l'
    elif c == 'j':
        c1 = 'm'
    elif c == 'k':
        c1 = 'n'
    elif c == 'l':
        c1 = 'o'
    elif c == 'm':
        c1 = 'p'
    elif c == 'n':
        c1 = 'q'
    elif c == 'o':
        c1 = 'r'
    elif c == 'p':
        c1 = 's'
    else:
        c1 = '*'
    return c1

def decoding(c):
    if c == 'd':
        c1 = 'a'
    elif c == 'e':
        c1 = 'b'
    elif c == 'f':
        c1 = 'c'
    elif c == 'g':
        c1 = 'd'
    elif c == 'h':
        c1 = 'e'
    elif c == 'i':
        c1 = 'f'
    elif c == 'j':
        c1 = 'g'
    elif c == 'k':
        c1 = 'h'
    elif c == 'l':
        c1 = 'i'
    elif c == 'm':
        c1 = 'j'
    elif c == 'n':
        c1 = 'k'
    elif c == 'o':
        c1 = 'l'
    elif c == 'p':
        c1 = 'm'
    elif c == 'q':
        c1 = 'n'
    elif c == 'r':
        c1 = 'o'
    elif c == 's':
        c1 = 'p'
    else:
        c1 = '*'
    return c1

def encode(s):
    answer = ""
    for c in s:
        c1 = encoding(c)
        answer = answer + c1
    return answer

def decode(s):
    answer = ""
    for i in range(0, len(s)):
        c = s[i]
        c1 = decoding(c)
        answer = answer + c1
    return answer
def main():
    string = raw_input( "Enter a string to encode: " )
    encodedString = encode(string)
    print "That encodes as '%s'" % encodedString
    decodedString = decode(encodedString)
    print "The encoding decodes as '%s'" % decodedString
    

main()
