Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func cipher(text string, direction int, int_shift int) string {
	shift, offset := rune(int_shift), rune(26)
	runes := []rune(text)
	for index, char := range runes {
		switch direction {
		case 1:
			if char >= 'a' && char <= 'z'-shift || char >= 'A' && char <= 'Z'-shift {
				char = char + shift
			} else if char > 'z'-shift && char <= 'z' || char > 'Z'-shift && char <= 'Z' {
				char = char + shift - offset
			}
		case -1:
			if char >= 'a'+shift && char <= 'z' || char >= 'A'+shift && char <= 'Z' {
				char = char - shift
			} else if char >= 'a' && char < 'a'+shift || char >= 'A' && char < 'A'+shift {
				char = char - shift + offset
			}
		}
		runes[index] = char
	}
	return string(runes)
}

func main() {
	for {
		infos := strings.Split(nextString(), " ")
		plain := make([]string, len(infos))
		if reflect.DeepEqual(infos, []string{}) {
			break
		}
		fmt.Println(infos)
		Decryption:
			for i := 0; i < 26; i++ {
				for j := range infos {
					plain[j] = cipher(infos[j], 1, i)
				}
				for j := range plain {
					if plain[j] == "this" || plain[j] == "that" || plain[j] == "the" {
						break Decryption
					}
				}
			}
			fmt.Println(strings.Join(plain, " "))
	}
}

Python: import sys, string

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

def s(ch, n):
    v = ""
    for c in ch:
        if c in string.ascii_lowercase:
            c = chr((ord(c) - ord("a") + int(n)) % 26 + ord("a"))
        v += c
    return v

for line in sys.stdin:
    k = line.split(" ")
    for i in range(26):
        li = []
        for j in k:
            li.append(s(j, i))
        if set(thelist) & set(li):
            break
    print(" ".join(li) + k[-1][-1])

Python: def main():
    words = input().split()
    bl = False
    for i in range(1,26):
        ans = ""
        for word in words:
            s = ""
            for string in word:
                os = ord(string)
                if os == 46:
                    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"):
              bl = True
            ans += " " + s
        if bl:
            break
    print(ans[1::])

if __name__ == "__main__":
    main()

Python: import sys
for b in sys.stdin:
 for i in range(26):
  c=''.join([e,chr((ord(e)-96+i)%26+97)][96<ord(e)<123]for e in b)
  if any(('the'in c,'this'in c,'that'in c)):print(c.strip())

Python: def decode(s, n):
    a = ""
    for i in s:
        if i.islower():
            o = ord(i) + n
            if o <= 122:
                a += chr(o)
            else:
                a += chr(o - 26)
        else:
            a += i
    return a

def judge(s):
    a = s.rstrip(".").split()
    return "the" in a or "this" in a or "that" in a

while True:
    try:
        s = input()
    except:
        break
    for i in range(1, 26):
        a = decode(s, i)
        if judge(a):
            print(a)
            break

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()