Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	for scanner.Scan() {
		var result string
		line := scanner.Text()
		key := make(map[string]string)

		var i int32
		for ; i < 52; i++ {
			makeKey(key, i)
			result = decode(key, line)

			if strings.Contains(result, "the") {
				break
			} else if strings.Contains(result, "this") {
				break
			} else if strings.Contains(result, "that") {
				break
			}
		}

		fmt.Println(result)
	}
}

func makeKey(key map[string]string, shift int32) {
	for i := 'a'; i <= 'z'; i++ {
		cipher := (i + shift)
		if cipher > 'z' {
			cipher = cipher%'z' + 'a' - 1
		} else if cipher < 'a' {
			cipher = cipher + ('z' - 'a') + 1
		}
		key[string(i)] = string(cipher)
	}
}

func decode(key map[string]string, cipher string) string {
	var result string
	for _, v := range cipher {
		if key[string(v)] != "" {
			result += key[string(v)]
		} else {
			result += string(v)
		}
	}
	return result
}

Python: import re


def code_shift(c, n_shift):
    return ord('a') + (ord(c) + n_shift - ord('a')) % 26


def get_candidate_plain(cipher, sym_ids, n_shift):
    plain = []
    for i, c in enumerate(cipher):
        if i not in sym_ids:
            plain.append(chr(code_shift(c, n_shift)))
        else:
            plain.append(c)
    plain = ''.join(plain)
    return plain


def decrypt(cipher):
    sym_ids = [m.start() for m in re.finditer(r'[\.\n\s]', cipher)]
    keyword = ['the', 'this', 'that']

    n_shift = 0
    while True:
        plain = get_candidate_plain(cipher, sym_ids, n_shift)
        for k in keyword:
            if plain.find(k) != -1:
                return plain
        n_shift += 1


if __name__ == '__main__':
    while True:
        try:
            cipher = input()
            print(decrypt(cipher))
        except:
            break

Python: s=input()

while True:
    if "this" in s and "that" in s and "the" in s:
        print(s)
        break

    s=list(s)
    for i in range(len(s)):
        if ord(s[i]) <= ord("z") and ord(s[i]) >= ord("a"):
            if s[i] != "z":
                s[i] = chr(ord(s[i])+1)
            else:
                s[i] = "a"
    s="".join(s)

Python: def judge_the(word):
	length=ord('t')-ord(word[0])
	if ord('h')-ord(word[1])==ord('e')-ord(word[2])==length:
		return True
	else:
		return False
while True:
	try:
		A=list(map(str,input().split()))
		l=int()
		for i in A:
			if len(i)==3:
				if judge_the(i)==True:
					l=ord('t')-ord(i[0])
					break
		for i in A:
			for c in i:
				if c=='.':
					print(c,end="")
				else:
					print(chr(ord(c)+l),end="")
			if i!=A[-1]:
				print(end=" ")
			else:
				print()
	except EOFError:
		break

Python: import sys
def main():
    ex = ["the", "this", "that"]
    lc = [chr(i) for i in range(97, 97 + 26)]
    #lowwer case

    for line in sys.stdin:
        s = line.split()

        for i in range(len(s)):
            a = s[i]
            cnt = 0
            while a not in ex and cnt < 25:
                a = list(a)
                for j in range(len(a)):
                    if a[j] == "z":
                        a[j] = "a"
                    elif a[j] == ".":
                        pass
                    else:
                        a[j] = lc[lc.index(a[j]) + 1]
                hoge = ""
                for j in a:
                    hoge += j

                a = hoge
                cnt += 1
            if cnt != 25:
                break

        for i in range(len(s)):
            a = list(s[i])
            for j in range(len(a)):
                if a[j] == ".":
                    pass
                else:
                    fuga = lc.index(a[j]) + cnt
                    if fuga > 25:
                        a[j] = lc[fuga - 26]
                    else:
                        a[j] = lc[fuga]
            else:
                hoge = ""
                for k in a:
                    hoge += k
                else:
                    s[i] = hoge

        for i in s:
            print(i, end = " ")
        print()
        print()


if __name__ == "__main__":
    main()

Python: strs='abcdefghijklmnopqrstuvwxyz'      #use a string like this, instead of ord()
def shifttext(shift):
    inp=input('')
    data=[]
    for i in inp:                     #iterate over the text not some list
        if i.strip() and i in strs:                 # if the char is not a space ""
            data.append(strs[(strs.index(i) + shift) % 26])
        else:
            data.append(i)           #if space the simply append it to data
    output = ''.join(data)
    return output
print(shifttext(22))

Python: 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)

Python: ca = ord('a')
def convert(s, d):
    res = []
    for c in s:
        if c not in ' .':
            c = chr(((ord(c) - ca + d) % 26) + ca)
        res.append(c)
    return "".join(res)
for line in open(0).readlines():
    s = line.strip()
    for d in range(26):
        s0 = convert(s, d)
        if "the" in s0 or "this" in s0 or "that" in s0:
            print(s0)
            break

Python: def restore(n,text):
    text_list=list(text)
    for i,j in enumerate(text_list):
        if ord(j)!=46 and ord(j)!=32:
            nw=ord(j)-n
            if nw<97:
                nw=ord(j)-n+26
            text_list[i]=chr(nw)
    print(''.join(map(str,text_list)))

def textsa(text):
    str_list=list(text)
    n=len(str_list)
    sa=[]
    for i in range(n-1):
        sa.append((ord(str_list[i+1])-ord(str_list[i]))%26)
    sa.append((ord(str_list[0])-ord(str_list[n-1]))%26)
    return sa


while True:
    try:
        text=input()
        wordlist=list(map(str,text.split()))
        for i in wordlist:
            if textsa(i)==[14,1,10,1] or textsa(i)==[14,19,19,0] or textsa(i)==[14,23,15]:
                n=ord(list(i)[0])-ord('t')
        restore(n,text)
    except:
        break

Python: s = raw_input()
li = s.split()

for i in li:
	if len(i) == 4 or len(i) == 3:
		a = ord(i[0]) - ord(i[1])
		b = ord(i[1]) - ord(i[2])
		c = ord(i[2]) - ord(i[3])
		
		if a == 12 and b == -1 and c == -10:
			n = ord(i[0]) - ord("t")
			break
		elif a == 12 and b == 3:
			n = ord(i[0]) - ord("t")
			break
		elif a == 12 and b == 7 and c == -19:
			n = ord(i[0]) - ord("t")
			break

o = ""
for c in s:
	if ord(c) >= 97 and ord(c) <= 122:
		o += chr(ord(c) - n)
	else:
		o += c

print(o)

Python: t = ord("t")
z = ord("z")
a = ord("a")

def _decode(tv, v):
    spam = ord(v)
    if not (a <= spam <= z):
        return v

    x = t - ord(tv)
    y = spam + x

    if y > z:
        y = a + (y % z)
    elif y < a:
        y = z - (a - y - 1)

    return chr(y)

while 1:
    try:
        txt = input()
        for s in [x for x in txt.split() if 3 <= len(x) <= 4]:
            tv = s[0]
            dec_val = ''.join(list(map(lambda x:_decode(tv,x),s)))

            if (dec_val in ('this', 'the', 'that')):
                print(''.join(list(map(lambda x:_decode(tv,x),txt))))
                break
    except:
        break