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 <iostream>
#include <string>
#define ALF 26
using namespace std;

int main(){
	string h[3] = {"the","that","this"};
	string s;
	while(getline(cin,s)){
	int c = 0;
	for(int j=0;j<ALF;j++){
		for(int m=0;m<3;m++){
			for(int k=0;k<=s.size()-h[m].size();k++){
				string t = s.substr(k,h[m].size());
				for(int l=0;l<h[m].size();l++) t[l] = (t[l]-'a'+j)%ALF + 'a';
				if(t==h[m]) c = j;
				cout << c << " " << t << " " << h[m] << endl;
			}
		}
	}
	for(int j=0;j<s.size();j++){
		if('a'<=s[j] and s[j]<='z') s[j] = (s[j]-'a'+c)%ALF + 'a';
	}
	cout << s << endl;
	}
}

C++: #include <bits/stdc++.h>
#include <vector>
using namespace std;
string str;	
int a, b, c, d;
int main(){
	while(getline(cin, str)){
		getline(cin, str);
		a = str.length();
		for(int i = 0; i < a; i++){
			if(str[i] < 97 || str[i] > 122){
				cout << str[i];
			}
			else {
				b = (int)str[i];
				b = b - 4;
				if(b < 97)
					b = b + 26;
				cout << (char)b;
			}
		}
		cout << endl;
	}
	return 0;
}

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

using namespace std;

int main(void) {
  string str;
  
  while(getline(cin, str)) {
    int cnt = 0;
    
    while(1) {
      for(int i=0; i<str.length(); i++)
	if(str[i] != ' ' && str[i] != '.') str[i] = (str[i]-'a' + 1)%26 + 'a';
      
      if(str.find("the") != string::npos || str.find("this") != string::npos || str.find("that") != string::npos) {
      	cout << str << endl;
	break;
      }
    }
    
  }
  return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
using namespace std;
typedef vector <string> vs;

vs split(const string &text, char delim=' '){
int start = 0, end = 0;
vs tokens;

for (int i=0; i<(int)text.size(); i++)
	if (text[i] == delim){
		end = i;
		tokens.push_back(text.substr(start, end - start));
		start = end + 1;
	}
	tokens.push_back(text.substr(start));
	return tokens;
}

int rot(string &text){
	for (int i=0; i<(int)text.size(); i++){
		char c=text[i];
		if (islower(c))
			if (c=='z') text[i]='a';
			else text[i]++;
	}
	return 0;
}

bool check(string text){
	vs words = split(text);
	for (int i=0; i<(int)words.size(); i++){
		string tmp = words[i];
		if (tmp=="the" || tmp=="this" || tmp=="that")
			return true;
	}
	return false;
}

int main(void){
	string text;
	while (true){
		getline(cin, text);
		if (cin.eof()) break;
		for (int i=0; i<26; i++){
			if (check(text)) break;
			else rot(text);
		}
		cout<<text<<endl;
	}
	return 0;
}

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

using namespace std;

int shift(const char* str, int len) {
	char t, h;
	char e, i, a, s;
	int dis;

	for (int pos = 0; pos < len - 1; pos++) {
		if (*(str + 1) == ' ' || *(str + 1) == '.' || *(str + 1) == ',') {
			pos += 2;
			continue;
		}
		t = *(str) - 'a';
		h = *(str + 1) - 'a';
		dis = (t > h) ? (t - h) : (t - h + 26);

		if (dis == 12) {
			e = (h - 3 + 26) % 26;
			i = (h + 1) % 26;
			s = (t - 1 + 26) % 26;
			a = (h - 7 + 26) % 26;

			if ((len > pos + 2 && *(str + pos + 2) == (e + 'a')) ||
				(len > pos + 3 && *(str + pos + 2) == (i + 'a') && *(str + pos + 3) == (s + 'a')) ||
				(len > pos + 3 && *(str + pos + 2) == (a + 'a') && *(str + pos + 3) == (t + 'a'))) {
				return (t - 19 + 26) % 26;
			}
		}
	}
	return -1;
}

int main(int argc, char* argv[])
{
	int s;
	std::string str;

	while (std::getline(cin, str)) {
		s = shift(str.c_str(), str.length());
		if (s == -1) continue;
		for (int i = 0; i < str.length(); i++) {
			printf("%c", (str[i] == ' ' || str[i] == '.' || str[i] == ',') ? str[i] : (char)('a' + ((str[i] - 'a' - s + 26) % 26)));
		}
		printf("\n");
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <sstream>
#include <fstream>

using namespace std;

int main()
{

//	cut here before submit 
//	freopen("testcase.cc", "r", stdin);
	const string key[] = { "the", "this", "that" };

	string str = "";
	
	while (getline (cin, str )){
		int len = str.length();
		int i,j;
		vector <bool> match (3, false);

		for (j = 0; j < 26; ++j){
			string curr = str;
			for (i = 0; i < len; ++i){
				if ( isalpha(str[i]) ){
					curr[i] = (str[i] - 'a' + j) % 26 + 'a';
				} // end if
			} // end for

			for (i = 0; i < 3; ++i){
				if ( curr.find(key[i]) != string::npos ){
					match[i] = true;
				} // end if
			} // end for
//			if ((int)count(match.begin(), match.end(), true ) > 0){
			if ((int)count(match.begin(), match.end(), true ) == sizeof(key)/sizeof(key[0]) ){

				cout << curr << endl;
				break;
			} // end if
		} // end for
	} // end while
		
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include<string>
#include<vector>
int main() {
	std::string s,a;
	std::getline (std::cin , s);
	int p = s[0] - 't';
	for (int i = 0; i < s.size(); ++i) {
		if (s[i] != ' ' &&s[i]!= '.') {
			if (s[i] - p < 'a') {
				a += 'z' - ('a' - (s[i] - p)-1);
			}
			else a += s[i] - p;
		}
		else a += s[i];
	}
	std::cout << a<< std::endl;
	return 0;
}

C++: #include <iostream>
#include <complex>
#include <cmath>
#include <cstdio>
#include <string>
#include <sstream>

using namespace std;

string rotate(string str) {
    for (int i = 0; i < str.size(); i++) {
        if ('a' <= str[i] && str[i] < 'z')str[i]++;
        else if (str[i] == 'z')str[i] = 'a';
    }
    return str;
}

int main() {
    string str;
    while(getline(cin, str)) {
        for (int i = 0; i < 26; i++) {
            str = rotate(str);
            string tmp;
            bool flg = false;
            for (int i = 0; i < str.size(); i++) {
                if (str[i] != '.')tmp += str[i];
            }
            stringstream ss(tmp);
            while(ss >> tmp) {
                if (tmp == "the" || tmp == "this" || tmp == "that")flg = true;
                break;
            }
            if (flg) {
                cout << str << endl;
                break;
            }
        }
    }
    return 0;
}

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

using namespace std;

int main() {
    while(!cin.eof()) {
        string str;
        getline(cin, str);
        for(int shift = 0; shift < 26; ++shift) {
            if(str.find("the") != string::npos || str.find("this") != string::npos || str.find("that") != string::npos) break;
            for(int i = 0; i < str.size(); ++i) 
                if(islower(str[i]) && ++str[i] > 'z') str[i] = 'a';
        }
        cout << str << endl;
    }
    return 0;
}