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>
#include<algorithm>
using namespace std;
int main() {
	string str, the = " the", dis = " this", that = " that";
	int zure, count = 0, i = 0;
	string judge = " ";
	bool bo = false;
	getline(cin, str);
		for (int j = 0; j < str.size(); j++) {
			zure = str[i] - 't';
			if (str[j] != ' ' && str[j]!='.') {
				if (str[j] - zure>='a'&&str[j]-zure<='z') {
					judge += str[j] - zure;
				}
				else if(str[j]-zure>'z'){
					judge += str[j] - 26 - zure;
				}
				else {
					judge += str[j] + 26 + zure;
				}
			}
			if (str[j] == ' ' || j == str.size() - 1) {
				if (judge == " the" || judge == " this" || judge == " that") {
					bo = true;
					break;
				}
				else {
					i = j+1 ;
					judge = " ";
				}
			}
		}
	for (int i = 0; i < str.size(); i++) {
		if (str[i] >= 'a'+abs(zure) && str[i] <= 'z' - abs(zure)) {
			str[i] -= zure;
		}
		else if ((str[i]-abs(zure) < 'a' || str[i]+abs(zure) > 'z') && str[i]!=' ' && str[i]!='.') {
			if (str[i] + zure > 'z') {
				str[i] -= zure; 
			}
			else if (str[i] - zure > 'z') {
				str[i] -= 26 + zure;
			}
			else if (zure < 0) {
				str[i] -= zure;
			}
			else {
				str[i] += 26 - zure;
			}
		}
		cout << str[i];
	}
	cout << endl;
	return 0;
}

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

bool decision(string input){
	for(int i = 0; i < input.size()-3; i++){
		if((input[i] == 't' && input[i+1] == 'h' && input[i+2] == 'e') ||
			(input[i] == 't' && input[i+1] == 'h' && input[i+2] == 'i' && input[i+3] == 's') ||
			(input[i] == 't' && input[i+1] == 'h' && input[i+2] == 'a' && input[i+3] == 't')){
			return true;
		}
	}
	return false;

}

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

	while(getline(cin, input);){
		for(int i = 0; i < input.size(); i++){
			if('a' <= input[i] && input[i] <= 'z'){
				if(input[i] != 'z'){
					input[i] += 1;
				}else{
					input[i] = 'a';
				}
			}
		}
		if(decision(input)) cout << input << endl;;
	}

	return 0;
}

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

// determine whether it is "the","this" or "that"
char is_article(string w) {
	char sh = '\0'; // shift defaults to 0
	if (w.size() == 3) {
		sh = 't' - w.front();
		for_each(w.begin(),w.end(),[sh](char &c){c += sh;});
		if (w != "the") {
			sh = '\0';
		}
	} else if (w.size() == 4) {
		sh = 't' - w.front();
		for_each(w.begin(),w.end(),[sh](char &c){c += sh;});
		if (w != "this" && w != "that") {
			sh = '\0';
		}
	}
	return sh;
}

int main() {
	string s;
	while (getline(cin,s)) {
		istringstream stream(s);
		string w;
		char sh;
		while (stream >> w) {
			if ((sh = is_article(w)) != '\0') {
				break;
			}
		}
		for_each(s.begin(),s.end(),[sh](char &c){c += c >= 'a' && c <= 'z' ? sh : '\0';});
		cout << s << endl;
	}
}

C++: #include<iostream>
#include<string>
int main(){
	std::string str;
	while(std::getline(std::cin,str)){
	for(int i=0;i<str.size();i++){
		if(str[i]!=' ')str[i]+=1;
	}
	std::cout<<str<<std::endl;
	}
	return 0;
}

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

using namespace std;

int main(){
  string s;
  while(getline(cin,s)){
    for(int i=1;i<26;i++){
      string ans;
      for(string::iterator it=s.begin();it!=s.end();it++){      
	if(*it==' '||*it=='.'){
	  ans.push_back(*it);
	  continue;
	}
	ans.push_back((char)(((int)*it-0x61+i)%26+0x61));
      }
      if(ans.find("the")!=string::npos||ans.find("this")!=string::npos||ans.find("that")!=string::npos){
	cout<<ans<<endl;
	break;
      }
    }
  }
  return 0;
}

C++: #include <iostream>
#include <string>
#include <string.h>
using namespace std;
int main(){
	string alpha = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz";
	string str;
	while( cin >> str, str ){
		getline( cin, str );
		for( int a = 0; a < 26; a++ ){
			for( int i = 0; i < str.length(); i++ ){
				for( int j = 0; j < alpha.length(); j++ ){
					if( str[i] == alpha[j] ){
						str[i] = alpha[j + 1];
						break;
					}
				}
			}
		/*char word = strtok( str.c_str(), " " );
		if( word == "the" || word == "that" || word == "this" ) break;
		while( word == NULL ){
			word = strtok( NULL, ' ' );
			if( word == "the" || word == "that" || word == "this" ) goto end;
		}*/
			if( str.find("the") != string::npos || str.find("this") != string::npos || str.find("that") != string::npos ){
				break;
			}
		}
		cout << str << endl;
	}
}

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

using namespace std;

void solve()
{
	string str;
	getline(cin, str);
	string word;
	int n = str.size();
	for(int j = 1; j < 26; ++j)
	{
		word.clear();
		for(int i = 0; i < n; ++i)
		{
			if('a' <= str[i] && str[i] <= 'z')
			{
				word += (str[i] + j -'a') % 26 + 'a';
			}
			else
			{
				word += str[i];
			}
		}
		if(word.find("this") != -1 || word.find("the") != -1 || word.find("that") != -1)
		{
			cout << word << endl;
		}
	}
}

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

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