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: while True:
  try:
    caesar = input()
  except EOFError:
    break
  for i in range(26):
    raw_letters = []
    for j in range(len(caesar)):
      if caesar[j] == " " or caesar[j] == ".":
        raw_letters.append(caesar[j])
      else:
        letter = ord(caesar[j])+(i+1)
        # 122 is ASCII 'z'
        if letter > 122:
          raw_letters.append(chr(letter-26))
        else:
          raw_letters.append(chr(letter))
    raw_strings = "".join(raw_letters)
    if ('the' in raw_strings) or ('this' in raw_strings) or ('that' in raw_strings):
      print(raw_strings)
      break

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

Python: '''
Created on Mar 22, 2013

@author: wukc
'''

from sys import stdin 

def shift(s):
    return ["".join([chr(97+(ord(x)-97+t)%26) if x.islower() else x for x in s]) for t in range(26)]

target=["this","the","that"]

for s in stdin:
    for x in shift(s):
        if sum(map(x.count,target))>0:
            print(x[:-1])

Python: if __name__ == '__main__':

	A = "abcdefghijklmnopqrstuvwxyz"

	while True:
		try:
			line = input()

			for d in range(1,27):
				t = line.translate(str.maketrans(A,A[d:] + A[:d]))
				if 'the' in t or 'this' in t or 'that' in t:
					print(t)
					break

		except EOFError:
			break

Python: def slide_char(char, num):

    if char == '.':
        return char

    if ord('A') <= ord(char) <= ord('Z'):

        if (ord(char) + num) <= ord('Z'):
            return chr(ord(char) + num)

        else:
            return chr(ord('A') + ord(char) + num - ord('Z') - 1)

    else:
        if (ord(char) + num) <= ord('z'):
            return chr(ord(char) + num)

        else:
            return chr(ord('a') + ord(char) + num - ord('z') - 1)


def main():

    check_words = ('the', 'this', 'that')

    caesar_chipher_text = tuple(map(str, raw_input().split()))

    for i in range(26):
        after_text = []
        flag = False

        for word in caesar_chipher_text:

            after_word = []

            for char in word:

                char = slide_char(char, i)
                after_word.append(char)

            after_text.append(after_word)

            if ''.join(after_word) in check_words:
                flag = True


        if flag:
            anser = []
            for text in after_text:
                anser.append(''.join(text))

            print(' '.join(anser))
            break


if __name__ == '__main__':
    main()

Python: import string
import sys

str = input()
alpha = string.ascii_lowercase

for str in sys.stdin:
    for i in range(len(alpha)):
        cipher_str = ""
        for s in str:
            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

Python: def main():
    ex =[ord(".")]
    while True:
        try:
            words = input().split()
        except:
            break
        bl = False
        for i in range(1,26):
            ans = ""
            for word in words:
                s = ""
                for string in word:
                    os = ord(string)
                    if os in ex:
                        s = s + string
                    else:
                        if os - i < 97:
                            s += chr(122 - (97 - (os - i)))
                        else:
                            s += chr(os - i)
                if s in ("the", "this", "that", "the.", "this.", "that."):
                  bl = True
                ans += " " + s
            if bl:
                break
        print(ans[1::])

if __name__ == "__main__":
    main()

Python: import sys


def _rot(c, i):
    if ord("a") < ord(c) and ord(c) < ord("z"):
        return chr((ord(c) - ord("a") + i) % 26 + ord("a"))
    if ord("A") < ord(c) and ord(c) < ord("Z"):
        return chr((ord(c) - ord("A") + i) % 26 + ord("A"))
    return c


def rot(str, i):
    g = [_rot(c, i) for c in str]
    return "".join(g)


def caesar(str):
    for i in range(26):
        s=".".join(rot(str, i).split()).split(".")
        if "the" in s or "that" in s or "this" in s:
            return rot(str,i)
    return 'none'

for line in sys.stdin:
    print(caesar(line.rstrip()))

while True:
    try:
        line = input()
        if line == '*':
            break
    except:
        break
    print(caesar(line))

Python: a='abcdefghijklmnopqrstuvwxy'
b=input()
for i in range(26):
 c=''.join(a[ord(e)-97-i]if e in a else e for e in b)
 if any(('the 'in c,'this 'in c,'that 'in c)):print(c);break

Python: while(1):
    try:
        slist = list(map(str, input().split()))
    except:
        break

    rot = 0
    for i in range(26):
        for s in slist:
            ch = ""
            for c in s:
                if "a" <= c <= "z":
                    g = chr((ord(c) - ord("a") + i) % 26 + ord("a"))
                else:
                    g = c
                ch += g
            if ch == "this" or ch == "that" or ch == "the":
                rot = i
                break
        if rot != 0:
            break

    for i, s in enumerate(slist):
        ch = ""
        for c in s:
            if "a" <= c <= "z":
                g = chr((ord(c) - ord("a") + rot) % 26 + ord("a"))
            else:
                g = c
            ch += g
        if i == len(slist) - 1:
            print(ch)
        else:
            print(ch + " ", end="")

Python: import sys

data = sys.stdin.read()
words = list('abcdefghijklmnopqrstuvwxyz')
txt = ''
for sft in range(0,len(words)):
    txt = ''.join([words[words.index(c) - len(words) + sft] if c in words else c for c in data])
    if 'the' in txt.split(' ') or 'this' in txt.split(' ') or 'that' in txt.split(' '):
        break
print(txt, end='')

Python: import sys

s = "abcdefghijklmnopqrstuvwxyz"

for line in sys.stdin:
  while True:
    if ("the" in line) or ("this" in line) or ("that" in line):
      break
    else:
      l = [i for i in line]
      for i in range(len(l)):
        if l[i] in s:
          a = s.index(l[i])
          l[i] = l[i].replace(l[i],s[(a+1)%26])
      line = "".join(l)
  print(line)