Caesar Cipher is a simple encryption method where each letter in the text is replaced by a letter a fixed number of positions down the alphabet. For example, with a shift of 1, 'a' becomes 'b', 'b' becomes 'c', 'y' becomes 'z', and 'z' becomes 'a'. Write a program to decrypt a text encrypted by Caesar Cipher. The number of shifts is secret and varies by dataset, but the decoded text will include either "the", "this", or "that". Input consists of several datasets, each with encrypted texts. The input ends with EOF. The text contains lowercase letters, periods, spaces, and end-of-lines, with lines being at most 80 characters long. Output the decoded texts in a line.

# Buggy version:
import string
import sys

line = input()
alpha = string.ascii_lowercase

for line in sys.stdin:
    for i in range(len(alpha)):
        cipher_str = ""
        for s in line:
            if s in alpha:
                cipher_str += alpha[(alpha.index(s)+i) % len(alpha)]
            else:
                cipher_str += s

        if ("the" or "this" or "that") in cipher_str:
            print(cipher_str)
            break
    else:
        print(line)

# Fixed version:
import string
import sys

alpha = string.ascii_lowercase

for line in sys.stdin:
    for i in range(len(alpha)):
        cipher_str = ""
        for s in line:
            if s in alpha:
                cipher_str += alpha[(alpha.index(s)+i) % len(alpha)]
            else:
                cipher_str += s

        if "the" in cipher_str or "this" in cipher_str or "that" in cipher_str:
            print(cipher_str, end="")
            break
    else:
        print(line, end="")

# Buggy version:
while True:
    try:
        b = input()
    except:
        break
    if 'the' in c or 'this' in c or 'that' in b:
        print(c)
    for i in range(1,26):
        c = ''
        for j in b:
            if(j == 'z'):
                c += ('a')
            elif(str.isalpha(j) == 1):
                c += (chr(ord(j) + 1))
            else:
                c += j
        if 'the' in c or 'this' in c or 'that' in c:
            print(c)
            break
        b = c

# Fixed version:
while True:
    try:
        b = input()
    except:
        break
    if 'the' in b or 'this' in b or 'that' in b:
        print(b)
    for i in range(1,26):
        c = ''
        for j in b:
            if(j == 'z'):
                c += ('a')
            elif(str.isalpha(j) == 1):
                c += (chr(ord(j) + 1))
            else:
                c += j
        if 'the' in c or 'this' in c or 'that' in c:
            print(c)
            break
        b = c

# Buggy version:
#!/usr/bin/env python
import sys
import re

def move(char, num):
    if ord(char) + num <= ord('z'):
        return ord(char) + num
    else:
        return ord(char) + num - (ord('z') - ord('a') + 1)

def shift(s, num):
    new = ""
    for i in range(0, len(s)):
        if s[i].isalpha():
            new += str(chr(move(s[i], num)));
        else:
            new += s[i]
    return new

def decrypt(s):
    for i in range(1, 26):
        decrypted = shift(s, i)
        if re.search('the|this|that', decrypted):
            print(decrypted)

if __name__ == '__main__':
    for line in sys.stdin:
        print(decrypt(line))

# Fixed version:
#!/usr/bin/env python
import sys
import re

def move(char, num):
    if ord(char) + num <= ord('z'):
        return ord(char) + num
    else:
        return ord(char) + num - (ord('z') - ord('a') + 1)

def shift(s, num):
    new = ""
    for i in range(0, len(s)):
        if s[i].isalpha():
            new += str(chr(move(s[i], num)));
        else:
            new += s[i]
    return new

def decrypt(s):
    for i in range(0, 26):
        decrypted = shift(s, i)
        if re.search('the|this|that', decrypted):
            return decrypted

if __name__ == '__main__':
    lines = []
    for line in sys.stdin:
        lines.append(line)
    for line in lines:
        print(decrypt(line), end="")

# Buggy version:
def ascii2num(ascii):
    return ord(ascii) - 96

def num2ascii(num):
    return chr(num + 96)

def slide(word,num):
    return ''.join([num2ascii((ascii2num(ascii) + num) % 26) if ascii != '.' else '.' for ascii in word])

def includekeyword(words):
    for word in words:
        if word in keywords:
            return True
    return False

keywords = ['the', 'this', 'that']


decode = []
for row in stdin:
    words = row.split()
    for num in range(1,27):
        tmp = [slide(word,num) for word in words]
        if includekeyword(tmp):
            decode = tmp
            print(' '.join(decode))

# Fixed version:
from sys import stdin

def ascii2num(ascii):
    return ord(ascii) - 96

def num2ascii(num):
    return chr(num + 96)

def slide(word,num):
    return ''.join([num2ascii((ascii2num(ascii) - num) % 26 + 1) if ascii != '.' else '.' for ascii in word])

def includekeyword(words):
    for word in words:
        if word in keywords:
            return True
    return False

keywords = ['the', 'this', 'that']

decode = []
for row in stdin:
    words = row.split()
    for num in range(1,27):
        tmp = [slide(word,num) for word in words]
        if includekeyword(tmp):
            decode = tmp
            print(' '.join(decode))
            break

# Buggy version:

import string
def CaesarCipher():
    
    low=string.ascii_lowercase
    
    for cry in sys.stdin: 
        for i in range(1,27):
            
            dec=cry.translate(str.maketrans(low,low[i:]+low[:i]))
    
            if 'this' in dec or 'that' in dec or 'the' in dec:
                print(dec)
            
                
    
CaesarCipher()

# Fixed version:

import string
import sys

def CaesarCipher():
    
    low=string.ascii_lowercase
    
    for cry in sys.stdin: 
        for i in range(1,27):
            
            dec=cry.translate(str.maketrans(low,low[i:]+low[:i]))
    
            if 'this' in dec or 'that' in dec or 'the' in dec:
                print(dec[:-1])
            
                
    
CaesarCipher()

# Buggy version:
import string
strings = string.ascii_lowercase
clues = [(19, 7, 8, 18), (19, 7, 0, 19), (19, 7, 4)]
while True:
    try:
        data = input()
    except:
        break
    for word in data.split():
        if len(word) == 4 or 3:
            dif = 19 - (ord(word[0]) - 97)
            enc = ["" for _ in range(26)]
            for k, v in zip([i for i in range(dif, dif+26)], strings):
                enc[k%26] = v
            candidate = tuple(enc.index(c) for c in word)
            try:
                clues.index(candidate)
            except:
                continue
            break
    ans = ""
    for c in data:
        try:
            ans += strings[enc.index(c)]
        except:
            ans += " "
    print(ans)



# Fixed version:
import string
strings = string.ascii_lowercase
clues = [(19, 7, 8, 18), (19, 7, 0, 19), (19, 7, 4)]
while True:
    try:
        data = input()
    except:
        break
    for word in data.split():
        if len(word) == 4 or 3:
            dif = 19 - (ord(word[0]) - 97)
            enc = ["" for _ in range(26)]
            for k, v in zip([i for i in range(dif, dif+26)], strings):
                enc[k%26] = v
            candidate = tuple(enc.index(c) for c in word)
            try:
                clues.index(candidate)
            except:
                continue
            break
    ans = ""
    for c in data:
        try:
            ans += strings[enc.index(c)]
        except:
            ans = ans + "." if c == "." else ans + " "
    print(ans)

# Buggy version:
import sys
a = 'abcdefghijklmnopqrstuvwxyz'
 
for s in sys.stdin:
	for n in range(1, 27):
		t = s[:-1].translate(str.maketrans(a, a[n:] + a[:n]))
		print(t)
		if 'the' in t or 'this' in t or 'that' in t: break
	print(t)

# Fixed version:
import sys
a = 'abcdefghijklmnopqrstuvwxyz'

for s in sys.stdin:
    for n in range(1, 27):
        t = s[:-1].translate(str.maketrans(a, a[n:] + a[:n]))
        if 'the' in t or 'this' in t or 'that' in t: break
    print(t)