Go: package main

import (
	"bufio"
	"os"
	"strings"
	"fmt"
)

var scanner = bufio.NewScanner(os.Stdin)

func cipher(text string, direction int, int_shift int) string {
	shift, offset := rune(int_shift), rune(26)
	runes := []rune(text)
	for index, char := range runes {
		switch direction {
		case 1:
			if char >= 'a' && char <= 'z'-shift || char >= 'A' && char <= 'Z'-shift {
				char = char + shift
			} else if char > 'z'-shift && char <= 'z' || char > 'Z'-shift && char <= 'Z' {
				char = char + shift - offset
			}
		case -1:
			if char >= 'a'+shift && char <= 'z' || char >= 'A'+shift && char <= 'Z' {
				char = char - shift
			} else if char >= 'a' && char < 'a'+shift || char >= 'A' && char < 'A'+shift {
				char = char - shift + offset
			}
		}
		runes[index] = char
	}
	return string(runes)
}

func main() {
	for scanner.Scan() {
		infos := strings.Split(scanner.Text(), " ")
		plain := make([]string, len(infos))
		// fmt.Println(infos)
		Decryption:
			for i := 0; i < 26; i++ {
				for j := range infos {
					plain[j] = cipher(infos[j], 1, i)
				}
				for j := range plain {
					if plain[j] == "this" || plain[j] == "that" || plain[j] == "the" {
						break Decryption
					}
				}
			}
			fmt.Println(strings.Join(plain, " "))
	}
}

C++: #include<iostream>
#include<cstring>
#include<sstream>
using namespace std;
/*
string text = "hello world";
stringstream ss(text);
string t;
while (ss >> t){
*/
void fin(string a)
{
	cout << a << endl;
	return;
}
int main()
{
	string a,b;
	bool fir=false;
	while (cin >> b)
	{
		if(fir)a.append(" ");
		a.append(b);
		fir = true;
	}
	while (1)
	{
		if (a.find("the", 0) != string::npos)
		{
			fin(a); return 0;
		}
		if (a.find("this", 0) != string::npos)
		{
			fin(a); return 0;
		}
		if (a.find("that", 0) != string::npos)
		{
			fin(a); return 0;
		}
		for (int i = 0; i < a.size(); i++)
		{
			if (a[i] != ' '&&a[i]!='.')a[i] += 1;
			if (a[i]>'z')a[i] = 'a';
		}
	}
	

}

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

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

C++: #include <cmath>
#include <iostream>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
#include <regex>

using namespace std;

string decode(string inp,int n){
    for(int i=0;i<inp.length();i++){
        if('a'<=inp[i]&&inp[i]<='z'){
            if(inp[i]-n<'a'){
                inp[i]='z'-(n-(inp[i]-'a')-1);

            }else{
                inp[i]=inp[i]-n;
            }
        }
    }
    return inp;
}
int main(){
    string input,decoded;
    regex pattern("(the)|(this)|(that)");
    while(getline(cin,input)){
        for(int i=0;i<26;i++){
            decoded=decode(input,i);
            if(regex_search(decoded.begin(),decoded.end(),pattern)){
                break;
            }
        }
        cout << decoded << endl;
    }
    return 0;
}

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

using namespace std;

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++) {
				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++) {
			ans += isalpha(str[i]) ? (str[i] - 'a' - s + 26) % 26 + 'a' : str[i];
		}
		cout << ans << endl;
	}
}

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

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

using namespace std;

int main() { 
  string input_str;

  getline(cin, input_str);

  int shift = 1;
  while (1) {
    for (int str_i = 0; str_i < input_str.size(); str_i++)
      if (!isspace(input_str[str_i]))
        input_str[str_i] -= shift;
    if (input_str.find("the") > 0 ||
        input_str.find("this") > 0 ||
        input_str.find("that") > 0)
      break;
  }

  cout << input_str << endl;

  return 0;
}

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

bool NotMatch( const std::string& str )
{
	return str.find("the") == std::string::npos && str.find("this") == std::string::npos && str.find("that") == std::string::npos;
}

int main()
{
	std::string str;
	while( getline(std::cin,str) )
	{
		while( NotMatch(str) )
		{
			for( unsigned i=0; i<str.length(); ++i )
			{
				if( str[i]=='.' || str[i]==' ' || str[i]=='\n' )
				{
					continue;
				}

				if( str[i] == 'z' )
				{
					str[i] = 'a';
				}
				else
				{
					++str[i];
				}
			}
		}

		std::cout << str << '\n';
	}
}

C++: 
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <stack>
#include <cctype>
#include <complex>
#include <vector>
#include <algorithm>

using namespace std;


bool solve(){
	
	string s;
	while(getline(cin,s)){
		string str[26];
		int num;
		for(int i=0;i<26;i++){
			str[i] = s;
			for(int j=0;j<str[i].size();j++){
				for(int k=0;k<i;k++){
					if(str[i][j]=='.' || str[i][j]==' '){
						continue;
					}
					if(str[i][j] == 'a'){
						str[i][j] = 'z';
					}
					str[i][j]--; 
				}
			}
			
			for(int j=0;j<str[i].size();j++){
				string str_temp, str_temp2;	
				if(j+3 <= str[i].size()){
					str_temp  = str[i].substr(j,3);
				}
				if(j+4 <= str[i].size()){
					str_temp2 = str[i].substr(j,4);
				}
				if(str_temp=="the" || str_temp2=="this" || str_temp2=="that"){
					num = i;
				}
			}
		}
		
		
		cout<< str[num]<< endl;
	}		
	
	return true;
}

int main(){
	cout.setf(ios::fixed);
	cout.precision(10);
	solve();

	return 0;
}

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



int main(int argc, const char * argv[])
{
    string word;
    while (getline(cin, word)) {
        int cnt = 0;
        for (char tmp2 = word[0]; tmp2 < 'z'; tmp2++) {
            if (tmp2 == 't') {
                break;
            }
            cnt++;
        }
        cnt = 0;
        for (char tmp2 = word[0]; tmp2 > 'a'; tmp2--) {
            if (tmp2 == 't') {
                break;
            }
            cnt--;
        }
        if (word[1] + cnt == 'h') {
            if (word[2] + cnt == 'e') {
                for (int i = 0; i < word.size(); i++) {
                    if (word[i] == '.') {
                
                    }
                    else if (word[i] != ' ') {
                        word[i] += cnt;
                    }
                }
            }
            if (word[2] + cnt == 'i' && word[3] + cnt == 's') {
                for (int i = 0; i < word.size(); i++) {
                    if (word[i] == '.') {
                        
                    }
                    else if (word[i] != ' ') {
                        word[i] += cnt;
                    }
                }
            }
            if (word[2] + cnt == 'a' && word[3] + cnt == 't') {
                for (int i = 0; i < word.size(); i++) {
                    if (word[i] == '.') {
                        
                    }
                    else if (word[i] != ' ') {
                        word[i] += cnt;
                    }
                }
            }
        }
        cout << word << endl;
    }

    
    return 0;
}