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
}

C++: #include <string>
#include <vector>
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <map>
#define INF 100000000

using namespace std;
typedef long long ll;

string change(string s){
    int len=s.size();
    for(int i=0;i<len;i++){
        if('b'<=s[i] && s[i]<='z')s[i]--;
        if(s[i]=='a')s[i]='z';
    }
    return s;
}

bool check(string s){
    int len=s.size();
    string tan="";
    for(int i=0;i<len;i++){
        if('a'<=s[i] && s[i]<='z'){
            tan+=s[i];
        }
        else{
            if(tan=="the" || tan=="this" || tan=="that" )return true;
            tan="";
        }
    }
    return false;
}


int main(){
    string s;
    getline(cin,s);
    while(1){
        s=change(s);
        if(check(s)){cout<<s<<endl;return 0;}
    }
    
    return 0;
}

C++: #include <iostream>
#include <string>

int main() {
	std::string str;
	std::getline(std::cin, str);
	
	std::string ans;
	for (auto c : str) {
		char elem = c - 4;
		if (c >= 'a' && c <= 'z') {
			if (elem < 'a') {
				elem = 'z' - 'a' + elem + 1;
			}
			ans.push_back(elem);
		} else {
			ans.push_back(c);
		}
	}
	
	std::cout << ans << std::endl;
}

C++: #include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>

using namespace std;
typedef long long ll;

int main(){
    int in;
    char S[1000];
    
    S[0]=' ';
    
    for(int i=1;;i++){
        
        in = getchar();
        
        if(in==EOF){
            S[i]='\0';
            break;
        }else{
            S[i]=(char)in;
        }
    }
    
    for(int k=0;;k++){
        
        bool f = false;
        
        for(int i=1;S[i]!='\0';i++){
            if('a'<=S[i] && S[i]<='y'){
                S[i]++;
            }else if(S[i]=='z'){
                S[i]='a';
            }
            
            if(i>=3 && (S[i+1]<'a' || 'z'<S[i+1]) && (S[i-3]<'a' || 'z'<S[i-3])){
                if(S[i-2]=='t' && S[i-1]=='h' && S[i]=='e')
                    f=true;
            }
            if(i>=4 && (S[i+1]<'a' || 'z'<S[i+1]) && (S[i-4]<'a' || 'z'<S[i-4])){
                if(S[i-3]=='t' && S[i-2]=='h')
                    if((S[i-1]=='i' && S[i-0]=='s') || (S[i-1]=='a' && S[i-0]=='t'))
                        f=true;
            }
        }
        
        if(f) break;
    }
    
    for(int i=1;S[i]!='\0';i++)
        printf("%c",S[i]);
    
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define rep(i,n) for(i=0;i<n;++i)
#define each(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); itr++)
#define mp make_pair
#define pb push_back
#define fi first
#define sc second

int main(int argc, char const *argv[]) {
  string s;
  while(getline(cin,s)){
    //cout << s << endl;
    string a="abcdefghijklmnopqrstuvwxyz";
    a += a;

    string t="";
    bool end=false;
    int i;
    for(int w=1; w<=25; ++w){
      printf("w=%d\n", w);
      t="";
      int p=0;
      rep(i,s.size()){
        if('a'<=s[i] && s[i]<='z'){
          t+=a[s[i]-'a'+w];
        }
        else{
          t+=s[i];
          string tmp=t.substr(p,i-p);
          //cout << tmp << endl;

          if(tmp=="this" || tmp=="the" || tmp =="that") end=true;

          p=i+1;
        }
      }

      if(end) break;
    }

    std::cout << t << std::endl;
  }
  return 0;
}

C++: import Control.Applicative
import Data.Char (readLitChar)
import Data.List
import System.IO

main = do
  eof <- isEOF
  if eof then return ()
         else do
            dataset <- getLine
            mapM_ putStrLn $ decodeCaesar (escape dataset)
            main

shiftChar :: Int -> Char -> Char
shiftChar n c
    | c == '.' = '.'
    | c == ' ' = ' '
    | c == '\n' = '\n'
    | otherwise = toEnum.(+97).(`mod` 26).(+ n).(subtract 97).fromEnum $ c

shiftString :: Int -> String -> String
shiftString n = map (shiftChar n)

decodeCaesar :: String -> [String]
decodeCaesar str = filter (\s -> ("this" `isInfixOf` s) || ("that" `isInfixOf` s) || ("the" `isInfixOf` s))
    $ map shiftString [1..25] <*> [str]

escape :: String -> String
escape [] = []
escape str = x : escape rest
  where [(x,rest)] = readLitChar str

C++: #include<iostream>

using namespace std;
int main()
{
	char key[100];

	while (cin >> key){

	for (int i = 0; i < sizeof(key); i++)
	{
		//if (key[i] == (int)" ")cout << "space";
		if ((int)key[i] <= 122 && (int)key[i] >= 97)
		key[i] = (int)key[i] - 1;
		if (key[i] == 96)key[i] = 122;
	}
	for (int i = 0; i < sizeof(key); i++)
		cout << key[i];
	}
	return 0;
}

C++: #include <iostream>
#include <string>

using namespace std;

string str;

bool caesar()
{
	bool flag = false;

	for (int i=0; i<(int)str.size() - 2; i++)
	{
		if(str[i] == 't' && str[i+1] == 'h') {
			if(str[i+2] == 'e' && (str[i+3] == ' ' || str[i+3] == '\0' || str[i+3] == '.')) {
				flag = true;
				break;
			}
			if(str[i+2] == 'i' && str[i+3] == 's' && (str[i+4] == ' ' || str[i+4] == '\0' || str[i+4] == '.')) {
				flag = true;
				break;
			}
			if(str[i+2] == 'a' && str[i+3] == 't' && (str[i+4] == ' ' || str[i+4] == '\0' || str[i+4] == '.')) {
				flag = true;
				break;
			}
		}
	}

	return flag;
}


int main()
{
	while(getline(cin, str))
	{
		for (int i=0; i<26; i++)	//0〜25文字ずれるまで繰り返す
		{
			if(caesar()) {
				cout << str << endl;
			}

			//cout << str << endl;	//Debug

			for (int j=0; str[j] != '\0'; j++) {
				if(str[j] != ' ' && str[j] != '.') {
					if(str[j] == 'z') {
						str[j] = 'a';
					}
					else {
						str[j]++;
					}
				}
			}
		}
	}

	return 0;
}