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 <stdio.h>
#include <math.h>

using namespace std;

int main(){

	char buf[81],result[81];
	bool FLG;
	short length;

	while(fgets(buf,81,stdin)!=0){
		FLG = false;
		length = 0;
		for(int i=0;buf[i]!='\0';i++)length++;
		for(int i=0;i<=25;i++){ //?????????????????°
			for(int k=0;buf[k]!='\0';k++){
				if(buf[k] >= 97 && buf[k] <= 122){
					if(buf[k]+i<=122){
						result[k]=buf[k]+i;
					}else{
						result[k]=97+(buf[k]+i-123);
					}
				}else{
					result[k]=buf[k];
				}
				result[k+1]='\0';
			}
			for(int k=0;result[k]!='\0';k++){
				// the this that ????????????????????????????????????
				if(length==4){
					if(result[0]=='t'&&result[1]=='h'&&result[2]=='e'&&result[3]=='.'){
						FLG=true;
						break;
					}
				}else{
					//??????
					if(result[0]=='t'&&result[1]=='h'&&result[2]=='e'&&result[3]==' '){
						FLG=true;
						break;
					}else if(result[0]=='t'&&result[1]=='h'&&result[2]=='i'&&result[3]=='s'&&result[4]==' '){
						FLG=true;
						break;
					}else if(result[0]=='t'&&result[1]=='h'&&result[2]=='a'&&result[3]=='t'&&result[4]==' '){
						FLG=true;
						break;
					}

					//????°?
					if(result[length-1]=='.'&&result[length-2]=='e'&&result[length-3]=='h'&&result[length-4]=='t'&&result[length-5]==' '){
							FLG=true;
							break;
					}
					if(length>5&&result[length-1]=='.'&&result[length-2]=='s'&&result[length-3]=='i'&&
							result[length-4]=='h'&&result[length-5]=='t'&&result[length-6]==' '){
							FLG=true;
							break;
					}else if(length>5&&result[length-1]=='.'&&result[length-2]=='t'&&result[length-3]=='a'&&
							result[length-4]=='h'&&result[length-5]=='t'&&result[length-6]==' '){
							FLG=true;
							break;
					}


					for(int p=4;result[p]!='\0';p++){
						if(result[p]==' ' && result[p-1] == 'e' && result[p-2] == 'h' && result[p-3] == 't' && result[p-4] == ' '){
							FLG = true;
							break;
						}
					}
					if(FLG)break;
					for(int p=5;result[p]!='\0';p++){
						if(result[p]==' ' && result[p-1] == 's' && result[p-2] == 'i' && result[p-3] == 'h' && result[p-4] == 't' && result[p-5] == ' '){
							FLG = true;
							break;
						}
					}
					if(FLG)break;
					for(int p=5;result[p]!='\0';p++){
						if(result[p]==' ' && result[p-1] == 't' && result[p-2] == 'a' && result[p-3] == 'h' && result[p-4] == 't' && result[p-5] == ' '){
							FLG = true;
							break;
						}
					}
					if(FLG)break;
				}
			}
			if(FLG)break;
		}
		printf("%s\n",result);

	}

    return 0;
}

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

// determine whether it is "the","this" or "that"
char get_shift(string w) {
	char sh = 't' - w.front();
	for_each(w.begin(),w.end(),[sh](char &c) {
		if (c != '.') {
			c += sh;
			if (c > 'z') {
				c -= (char)26;
			} else if (c < 'a') {
				c += (char)26;
			}
		}
	});
	if (w.find("the") == string::npos && w.find("this") == string::npos && w.find("that") == string::npos) {
		sh = '\0';
	}
	return sh;
}

int main() {
	string s;
	while (getline(cin,s)) {
		istringstream stream(s);
		string w;
		char sh;
		while (stream >> w) {
			while (!w.empty() && w.front() == '.') {
				w.erase(0,1);
			}
			while (!w.empty() && w.back() == '.') {
				w.pop_back();
			}
			if (!w.empty()) {
				if ((sh = get_shift(w)) != '\0') {
					break;
				}
			}
		}
		for_each(s.begin(),s.end(),[sh](char &c) {
			if (c >= 'a' && c <= 'z') {
				c += sh;
				if (c > 'z') {
					c -= (char)26;
				} else if (c < 'a') {
					c += (char)26;
				}
			}
		});
		cout << s << endl;
	}
}

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

using namespace std;

int main()
{
  string stro, str;
  while(getline(cin, stro)){
    for(int i = 1; i < 26; i++){
      str = stro;
      for(int j = 0; j < stro.length(); j++){
	if(str[j] != ' ' && str[j] != '.' && str[j] != '\n')
	  if(str[j] + i > 'z')
	    str[j] += i - 26;
	  else
	    str[j] += i;
      }
	if(str.find("the", 0) != string::npos || str.find("this", 0) != string::npos || str.find("that", 0) != string::npos)
	  cout << str << endl;	
    }
  }
}

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

using namespace std;

int main()
{
    string s;
    while (getline(cin, s)) {
        for (int o = 0; ; o++) {
            string p = s;
            for (int i = 0; i < p.size(); i++) {
                if (isalpha(p[i])) {
                    p[i] = ((p[i] - 'a' + o) % 26) + 'a';
                }
            }
            if (p.find("that") != -1 || p.find("this") != -1 || p.find("the") != -1) {
                cout << p << endl;
                break;
            }
        }
    }
}

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

using namespace std;

char data[26]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
char trans[100];
char mozi;
int position=0;
int zoom;
int first_check=0,first_position=0;
int now;
char result;
int flag = 0;

int main(){
	while(flag == 0){
		scanf("%c",&mozi);
		if(first_check == 0)

		for(int i=0;i<26 && first_check == 0;i++){
			if(mozi == data[i]){
				first_position = i;
				zoom = first_position - 19;
				first_check = 1;
				break;
			}
		}




		if(mozi == ' ' || mozi == '.' || mozi == '\n'){
			if(mozi == ' ' || mozi == '.'){
				trans[position] = mozi;
				position++;
			}

			if(mozi == '\n'){
				//trans[position] = '\n';
				cout << trans << endl;
				first_check = 0;
				position = 0;
				memset(trans,'\0',sizeof(trans));
				flag = 1;
			}
		}else{
			for(int i=0;i<26;i++){
				if(data[i] == mozi){
					now = i;
					break;
				}
			}

			trans[position] = data[now - zoom];
			position++;

		}
	}
}

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

using namespace std;
int main(){
	string str1;
	int i, j, n = 0;
	while(getline(cin, str1)){
		bool change = false;
		for(i = 0;i < 28;i++){
			for(j = 0;j < str1.size();j++){
				if(str1[j] != ' ' && str1[j] != '.'){
					if(str1[j] == 'a'){
						str1[j] = 'z';
					}
					else str1[j] -= 1;
				}
			}
			for(j = 0;j+3 < str1.size();j++){
				if(str1[j] == 't' && str1[j+1] == 'h'){
					//if(str1[j+2] == 'e' || (str1[j+2] == 'i' && str1[j+3] == 's') || (str1[j+2] == 'a' && str1[j+3] == 't')){
						n = i + 1;
						change = true;
						break;
					//}
				}
			}
			if(change) break;
		}	
		for(i = 0;i < str1.size();i++){
			cout << str1[i];
		}
		cout << endl;
		
	}


	return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
int main(){
      string s;
      while(getline(cin,s)){
            for(int i=0;i<25;i++){
                  if(s.find("the")!=-1||s.find("this")!=-1||s.find("that")!=-1)break;
                  else for(int j=0;j<s.size();j++)if(s[j]>='a'&&s[j]<='z')s[j]!='z'?s[j]++:s[j]='a';
            }
            cout<<s<<endl;
      }
}