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


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):
    test=[]
    for i in range(26):
        test = rot(str, i).split()
        if ("this" in test) or ("that" in test) or ("the" in test)or("this." in test) or ("that." in test):
            return " ".join(test)
    return "nan"


a = []
for line in sys.stdin:
    a.append(line)
for i in range(len(a)):
    print(caesar(a[i]))

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

Python: a='abcdefghijklmnopqrstuvwxyz'
while 1:
    try:s=input()
    except:break
    for i in range(1,27):
        b=''
        for x in s:
            b+=a[a.index(x)-i]if x in a else x
        if 'the' in b or 'this' in b or 'that' in b:print(b);break

Python: s = input()[:-1].split()
D = 0
for word in s:
    if len(word) == 3:
        diff = []
        for c, d in zip(word, 'the'):
            diff.append(ord(c) - ord(d))
        if diff.count(diff[0]) == 3:
            D = diff[0]
            break
    if len(word) == 4:
        diff = []
        for c, d in zip(word, 'that'):
            diff.append(ord(c) - ord(d))
        if diff.count(diff[0]) == 4:
            D = diff[0]
            break
        diff = list([])
        for c, d in zip(word, 'this'):
            diff.append(ord(c) - ord(d))
        if diff.count(diff[0]) == 4:
            D = diff[0]
            break


print(D)
li = []
for word in s:
    t = ""
    for c in word:
        t += chr( (ord(c) - ord('a') + 26 - D) % 26 + ord('a') )
    li.append(t)
print(" ".join(li) + '.')

Python: while 1:
    try:
        n=float('inf')
        s=raw_input().strip('.').split()
        for i in xrange(26):
            for j in s:
                r=[]
                for k in j:
                    if ord(k)+i<123:
                        r.append(chr(ord(k)+i))
                    else:
                        r.append(chr(97+ord(k)+i-123))
                if "".join(r)=="this" or "".join(r)=="that" or "".join(r)=="the":
                    n=i
            if n!=float('inf'):
                break
        ans=[]
        for i in s:
            splitans=[]
            for j in i:
                if ord(j)+n<123:
                    splitans.append(chr(ord(j)+n))
                else:
                    splitans.append(chr(97+ord(j)+n-123))
            ans.append(''.join(splitans))
        print(' '.join(ans)+'.')
    except:
        break

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):
        test = rot(str, i).split()
        if ("this" in test) or ("that" in test) or ("the" in test)or("this." in test) or ("that." in test):
            return " ".join(test)
    return "nan"


print(caesar(input()))

Python: s = list(input())
while True:
    for i, c in enumerate(s):
        char_code = ord(c)
        if 97 <= char_code <= 122:
            char_code = char_code+1 if char_code < 122 else 97
            s[i] = chr(char_code)

    _s = "".join(s)
    if "this" in _s or "the" in _s or "that" in _s:
        print(_s)
        exit()

Python: # Aizu Problem 0017: Caesar Cipher
#
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")

def caesar_decrypt(N, cipher):
    text = ""
    for char in cipher:
        if 'a' <= char <= 'z':
            k = (ord(char) - 97 - N) % 26
            text += chr(97 + k)
        else:
            text += char
    return text

cipher = input()
for k in range(26):
    decrypted = caesar_decrypt(k, cipher)
    if "this" in decrypted or "the" in decrypted or "that" in decrypted:
        print(decrypted)
        break

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"]

s=stdin.readline()

for x in shift(s):
    if sum(map(x.count,target))>0:
        print(x)

Python: import string
import sys

example = string.ascii_lowercase

def make(x, y, z, a, b, c = True) :
    if x - a < 0 : y = 26 + (x - a)
    else : y = x - a
    if x - b < 0 : z = 26 + (z - b)
    else : z = x - b
    if c != True :
        if x - c < 0 : n = 26 + (x - c)
        else : n = x - c
    if c != 0 : return (example[x] + example[y] + example[z])
    else : return (example[x] + example[y] + example[z])
    
def solve(temp, number) :
    new_temp = []
    if number > 19 : number = number - 19
    else : number = 19 - number
    for _ in temp :
        if _ == ' ' or _ == '.' : new_temp.append(_)
        elif _ - number < 0 : new_temp.append(26 + (_ - number))
        else : new_temp.append(_ - number)
    temp = ''
    for _ in new_temp :
        if _ == ' ' or _ == '.' : temp += _
        else : temp += example[_]
    return temp

for input_string in sys.stdin :
    test = input_string
    temp = []
    for _ in test : 
        if _ == ' ' or _ == '.' : temp.append(_)
        elif _ in example : temp.append(example.index(_))

    check = 0
    the = []
    for _ in range(26) : the.append(make(_, _, _, 12, 15))
    for number, _ in enumerate(the) :
        if _ in test :
            print(solve(temp, number))
            check = 1
    
    if check == 1 :
        this = []
        for _ in range(26) : this.append(make(_, _, _, 12, 13, 24))
        for number, _ in enumerate(this) :
            if _ in test :
                print(solve(temp, number))
                check = 1
    
    if check == 1 :
        that = []
        for _ in range(26) : this.append(make(_, _, _, 12, 13, 24))
        for number, _ in enumerate(this) :
            if _ in test : print(solve(temp, number))