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 <functional>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <iomanip>
#include <utility>
#include <cstdlib>
#include <sstream>
#include <bitset>
#include <vector>
#include <cstdio>
#include <ctime>
#include <queue>
#include <deque>
#include <cmath>
#include <stack>
#include <list>
#include <map>
#include <set>

using namespace std;

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;

#define dump(x)  cerr << #x << " = " << (x) << endl
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back


int main() {
    string s;
    getline(cin,s);

    while(1){
        if( s.find("this")!=string::npos || s.find("that")!=string::npos ||s.find("the")!=string::npos )break;
        rep(i,s.size()){
            if(s[i]<='z' && s[i]>='a'){
                if(s[i]=='a')s[i]='z';
                else{
                    s[i]--;
                }
            }
        }
    }
    cout<<s<<endl;
    
    
    return 0;
}

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

using namespace std;

int main() {
	string str, str2, ans;
	int i, j, l, n = 0;
	while (cin >> str) {
		ans += str;
		ans += ' ';
		if (n != 0) {
			continue;
		}
		l = str.length();
		str2.resize(l);
		for (i = 1; i < 26; i++) {
			for (j = 0; j < l; j++) {
				if (str[j] == '.') {
					continue;
				}
				if (str[j] + i > 'z') {
					str2[j] = str[j] - 26 + i;
				}
				else {
					str2[j] = str[j] + i;
				}
			}
			if (str2 == "the" || str2 == "the." || str2 == "this" || str2 == "this." || str2 == "that" || str2 == "that.") {
				n = i;
				break;
			}
		}
	}
	l = ans.length();
	ans.erase(l - 1);
	for (i = 0; i < l; i++) {
		if (ans[i] == '.' || ans[i] == ' ') {
			continue;
		}
		if (ans[i] + n > 'z') {
			ans[i] = ans[i] - 26 + n;
		}
		else {
			ans[i] = ans[i] + n;
		}
	}
	cout << ans << endl;
	return 0;
}

C++: #include <iostream>
#include <cmath>
#include <sstream>
using namespace std;

string inc(string str, int c)
{
    for (int i = 0; i < str.size(); ++i) {
        if (str[i] < 'a' || 'z' < str[i])
            continue;
        int tmp = (str[i] - 'a' + c)%26;
        str[i] = 'a' + tmp;
    }
    return str;
}

int main(void)
{
    bool flag;
    string str;
    while (getline(cin, str)) {

    for (int i = 0; i < 26; ++i) {
        flag = false;
        string tmp;
        stringstream ss;
        ss << str;
        while (!ss.eof()) {
            ss >> tmp;
            tmp = inc(tmp, i);
            flag += tmp == "this";
            flag += tmp == "that";
            flag += tmp == "the";
            flag += tmp == "this.";
            flag += tmp == "that.";
            if (flag)
                break;
        }
        if (flag) {
            cout << inc(str, i) << endl;
            break;
        }
    }
    }
    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() - 3; i++)
	{
		if(str[i] == 't' && str[i+1] == 'h') {
			if(str[i+2] == 'e') {
				flag = true;
				break;
			}
			if(str[i+2] == 'i' && str[i+3] == 's') {
				flag = true;
				break;
			}
			if(str[i+2] == 's' && str[i+3] == 't') {
				flag = true;
				break;
			}
		}
	}

	return flag;
}


int main()
{
	getline(cin, str);

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

		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;
}

C++: #include<iostream>
using namespace std;
int main(){ 
  char a[80];
  int i;
  while(cin>>a[i]){
    if(a[i]>='a'&&a[i]<='z')cout<<(char)(a[i]-4);
    else cout<<a[i];
    i++;
  }
  cout<<endl;
  return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
 
#define INPUT_FROM_FILE (0) 
#if INPUT_FROM_FILE
#include <fstream>
#endif

int main(int argc, char **argv){
	std::string str;
	std::string buf;

#if INPUT_FROM_FILE
	std::ifstream ifs("test.txt");
#endif

#if INPUT_FROM_FILE
	while(std::getline(ifs, buf)){
#else
	while(std::getline(std::cin, buf)){
#endif
		str = buf;


		for(int i = 1; i <= 26; i++){
			for(int j = 0; j < str.size(); j++){
				unsigned char c = str[j];

				if(c >= 'a' && c <= 'z'){
					if(c == 'z'){
						c = 'a';
					}
					else{
						c++;
					}
				}
				str[j] = c;
			}

			std::istringstream stream(str);
			while(stream >> buf){
				if(buf == "the" || buf == "this" || buf == "that"){
					i = 27;
					break;
				}
			}
		}
		std::cout << str << std::endl;
	}
	return 0;
}

C++: #include <cstdio>
#include <iostream>
#include <string>
using namespace std;

int main()
{
	string s;
	while(getline(cin, s)){
	
		while(s.find("the") == s.npos && s.find("this") == s.npos && s.find("that") == s.npos){
			for(size_t i=0;i<s.size();i++){
				if(s[i]>='a' && s[i]<='y'){
					s[i]++;
				}else if(s[i]=='z'){
					s[i] = 'a';
				}
			}
		}
		//whileを抜けたときにはtheかthisかthatが含まれている
		cout<<s<<endl;
	}
	return 0;
}

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

using namespace std;

void solve()
{
	string str;
	while(getline(cin, str))
	{
		int n = str.size();
		for(int i = 0; i < 26; ++i)
		{
			string Ans = str;
			for(int j = 0; j < n; ++j)
			{
				if('a' <= Ans[j] && Ans[j] <= 'z')
				{
					if(Ans[j] + i > 'z')
					{
						Ans[j] += i;
						Ans[j] -= 26;
					}
					else
					{
						Ans[j] += i;
					}
				}
			}
			for(int j = 0; j < n; ++j)
			{
				if(Ans[j] == 't')
				{
					if((j + 1 < n && Ans[j + 1] == 'h') && (j + 2 < n && Ans[j + 2] == 'i') && (j + 3 < n && Ans[j + 3] == 's'))
					{
						cout << Ans << endl;
						goto END;
					}
					else if(j + 1 < n && Ans[j + 1] == 'h' && j + 2 < n && Ans[j + 2] == 'a' && j + 3 < n && Ans[j + 3] == 't')
					{
						cout << Ans << endl;
						goto END;
					}
					else if(j + 1 < n && Ans[j + 1] == 'h' && j + 2 < n && Ans[j + 2] == 'e')
					{
						cout << Ans << endl;
						goto END;
					}
				}
			}
		}
	}
END:
	;
}

int main()
{
	solve();
	return(0);
}

C++: #include <stdio.h>
#include <string.h>

char buf[99];

int main(){
    int i;

    for(;~scanf("%[^\n] ",buf);){
        for(i=0; ; i++){
            if( buf[i]-buf[i+1] == 12 ){
                break;
            }
        }
        int sa = buf[i] - 't';
        for(i=0; buf[i]!='\0'; i++){
            buf[i]=!putchar( buf[i] - (97>buf[i] ? 0: sa) );
        }
        puts("");
    }
    return 0;
}