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>
using namespace std;
#include <stdio.h>
#include <string.h>
#include <string>
#include <algorithm>
#include <vector>

void q17() {
	vector<string> hints;
	hints.push_back("the");
	hints.push_back("this");
	hints.push_back("that");

	vector<vector<string>> shiftHints;
	for (int i = 0; i < 26; i++) {
		vector<string> iShiftHints;
		for (int j = 0; j < hints.size(); j++) {
			string tmp = "";
			for (int k = 0; k < hints[j].length(); k++) {
				char z = ((hints[j][k] - 'a' + i) % 26) + 'a';
				tmp += ((hints[j][k] - 'a' + i) % 26) + 'a';
			}
			iShiftHints.push_back(tmp);
		}
		shiftHints.push_back(iShiftHints);
	}

	string str;
	for (; getline(cin, str);) {
		int s;
		bool flag = false;
		for (s = 0; s < 26; s++) {
			for (int i = 0; i < hints.size(); i++) {
				if (str.find(shiftHints[s][i]) != -1) {
					flag = true;
				}
			}
			if (flag) break;
		}

		string ans = "";
		for (int i = 0; i < str.length(); i++) {
			if ('a' <= str[i] && str[i]<= 'z') {
				ans += (str[i] - 'a' - s) % 26 + 'a';
			}
			else {
				ans += str[i];
			}
		}
		cout << ans << endl;
	}
}

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

C++: #include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main(){
  string s;
  int pl=0;
  while(getline(cin,s)){
  for(int i =-30;i<30;i++){
    for(int j = 0; j < s.size()-3; j++){
      if(s[j]+i=='t' &&s[j+1]+i == 'h' && s[j+2]+i == 'e'&& s[j+3]==' '){
	pl = i;
	break;
      }
      if(j==s.size()-1) break;
      if(s[j]+i=='t' &&s[j+1]+i == 'h' && s[j+2]+i == 'a' && s[j+3]+i=='t' && s[j+4]==' '){
	pl = i;
	break;
      }
      if(s[j]+i=='t' &&s[j+1]+i == 'h' && s[j+2]+i == 'i' && s[j+3]+i=='s' && s[j+4]==' '){
	pl = i;
	break;
      }
    }
    if(pl!=0) break;
  }
  for(int i=0;i <s.size();i++){
    if(s[i]<='z' && s[i]>='a') s[i] += pl;
  }
  cout<<s<<endl;
  pl=0;
  }
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#define INF 1000000000

using namespace std;

// the this that

vector<string> split(string str, string delim) {
  vector<string> res;
  int cutAt;
  while ((cutAt = str.find_first_of(delim))!=str.npos) {
    if (cutAt > 0) {
      res.push_back(str.substr(0,cutAt));
    }
    str = str.substr(cutAt+1);
    if (str.length() > 0) {
      res.push_back(str);
    }
  }
  return res;
}

int main() {
  string str;
  while (getline(cin, str)) {
    vector<string> strs=split(str," ");
    int key=0;
    for (int i=0; i<strs.size(); i++) {
      while (strs[i].find(".")!=string::npos) {
	strs[i].erase(strs[i].find("."));
      }
      if (strs[i].length()==3&&strs[i][0]-'t'==strs[i][1]-'h'&&strs[i][1]-'h'==strs[i][2]-'e') {
	key = strs[i][0]-'t';
	break;
      } else if (strs[i].length()==4) {
	if (strs[i][0]-'t'==strs[i][1]-'h'&&strs[i][1]-'h'==strs[i][2]-'a'&&strs[i][2]-'a'==strs[i][3]-'t') {
	  key = strs[i][0]-'t';
	  break;
	}
	if (strs[i][0]-'t'==strs[i][1]-'h'&&strs[i][1]-'h'==strs[i][2]-'i'&&strs[i][2]-'i'==strs[i][3]-'s') {
	  key = strs[i][0]-'t';
	  break;
	}
      }
    }
    for (int i=0; i<str.length(); i++) {
      if (isalpha(str[i])) {
	str[i]-=key;
      }
    }
    cout<<str<<endl;
  }
}

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

bool howMuchWords(string s, string key){
  string::size_type index = s.find(key);
  if(index == string::npos){
    return false;
  }else{
    //???????????£???.
    return true;
  }
}
    

int main(){
  string s;
  getline(cin ,s);
  int cnt=0;
  while(true){
    if(howMuchWords(s, "that") || howMuchWords(s, "this") || howMuchWords(s, "the")){
      // cout << cnt << ": ";
      cout << s << endl;
      break;
    }

    for(int i=0;i<s.length();i++){
      s[i] = s[i] + 1;
    }
    
  }
}

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

int main(){

   string str;
   bool ans=false;
   
   
   while(getline(cin,str)){
   ans=false;
   
   string::iterator ite=str.begin();
   
   while(1){
      //cout << str.find("the");
      if(str.find("the")<=str.size()) ans=true;
      else if(str.find("this")<=str.size()) ans=true;
      else if(str.find("that")<=str.size()) ans=true;
      if(ans) break;
      for(int i=0;i<str.size();i++){
         if(*(ite+i)>='A'&&*(ite+i)<='z') *(ite+i)-=1;
      }
   }
   cout << str << endl;
   }
   return 0;
}

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

using namespace std;

int main()
{
	char in[81];
	char tht[3][10] = {"the","this","that"};
	int len;
	bool end;

	while(gets(in)){
		len = strlen(in);
		end = false;
		for(int i = 0; i < 26; i++){
			for(int j = 0; j < len; j++){
				if(in[j] >= 'a' && in[j] <= 'z'){
					if(in[j] == 'z'){
						in[j] = 'a';
					}
					else{
						in[j]++;
					}
				}
			}
			for(int c = 0; c < 3; c++){
				if(strstr(in,tht[c]) != NULL){
					printf("%s\n",in);
					end = true;
					break;
				}
			}
			
			if(end){
				break;
			}
		}
	}

	return 0;
}

C++: #include <iostream>
#include <cmath>
#include <cstdio>
#include <vector>

using namespace std;
string s;
char decrypt[100];
int key,i;

int main(){
    while(getline(cin,s)){
        const char *encrypt = s.c_str();
        while(encrypt[i] != '\0'){
            if(encrypt[i] - encrypt[i+1] == 12){
                key = 't' - encrypt[i];
                break;
            }
            else if(i >= 1 && encrypt[i-1] == ' ' && encrypt[i] - encrypt[i+1] == 12){
                key = 't' - encrypt[i];
                break;
            }
            i++;
        }

        i = 0;
        while(encrypt[i] != '\0'){
            if(encrypt[i] <= 'z' && encrypt[i] >= 'a'){
                decrypt[i] = (encrypt[i] - 'a' + key + 26) % 26 + 'a';
            }
            else{
                decrypt[i] = encrypt[i];
            }
            i++;
        }
        while(i <= 99){
            decrypt[i] = '\0';
            i++;
        }
        printf("%s\n", decrypt);
    }
    return 0;
}