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 <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>

using namespace std;
typedef long long ll;

int main(){
    int in;
    char S[1000];
    
    while(NULL!=gets(S)){
    
    while(1){
        
        bool f = false;
        
        for(int i=0;S[i]!='\0';i++){
            if('a'<=S[i] && S[i]<='y'){
                S[i]++;
            }else if(S[i]=='z'){
                S[i]='a';
            }
            
            if(i>=2){
                if(S[i-2]=='t' && S[i-1]=='h' && S[i]=='e')
                    f=true;
            }
            if(i>=3){
                if(S[i-3]=='t' && S[i-2]=='h')
                    if((S[i-1]=='i' && S[i]=='s') || (S[i-1]=='a' && S[i]=='t'))
                        f=true;
            }
        }
        
        if(f) break;
    }
    
    printf("%s\n",S);
    }
    
    return 0;
}

C++: #include <string>
#include <vector>
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <map>
#define INF 100000000
#define rep(i,a) for(int i=0;i<(a);i++)

using namespace std;
typedef long long ll;

char p(char ch){
    char ret=ch+1;
    if(ret==('{'))ret='a';
    return ret;
}


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


    rep(i,30){
        rep(i,s.size()){
            if(s[i]!=' ' && s[i]!='.'){
                s[i]=p(s[i]);
            }
        }

        if( s.find("the",0)!=-1 || s.find("this",0)!=-1 || s.find("that",0)!=-1 ){
            break;
        }
    }
    cout<<s<<endl;
    
    return 0;
    
}

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

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

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

char ab(char c){
	if(c == 'z'){
		return 'a';
	}
	if(c == ' ' || c == '.' || c == '\n'){
		return c;
	}
	return c + 1;
}

char ba(char c){
	if(c == 'a'){
		return 'z';
	}
	if(c == ' '|| c == '.' || c == '\n'){
		return c;
	}
	return c - 1;
}

int main(){
	char s[82];
	char *f;
	char c;
	int sh, a;

	while(scanf("%c", &s[0]) + 1){
		char th[3][5] = {"the", "this", "that"};

		a = 0;
		while(s[a] - 10){
			a++;
			scanf("%c", &s[a]);
		}
	
		a++;
		s[a] = '\0';
		f = 0;
		for(int i = 0; i < 26; i++){
			f = 0;
			for(int j = 0; j < 3; j++){
				f = strstr(s, th[j]);
				if(f){
					j += 3;
					sh = i;
					i += 26;
				}
			}

			for(int j = 0; j < 3; j++){
				int t = 0;
				while(th[j][t]){
					th[j][t] = ab(th[j][t]);
					t++;
				}
			}
		}

		a = 0;
		while(s[a]){
			char shc = s[a];
			for(int i = 0; i < sh; i++){
				shc = ba(shc);
			}
			printf("%c", shc);
			a++;
		}
	}
}

C++: #define _USE_MATH_DEFINES

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <utility>
#include <vector>
#include <numeric>

using namespace std;

int caesar(string s)
{
	string s0 = "this";
	string s1 = "that";
	string s2 = "the";

	if (s.size() > 5)
	{
		return -1;
	}

	for (int i = 0; i <= 26; i++)
	{
		if (s.substr(0, 4) == s0 || s.substr(0, 4) == s1 || s.substr(0, 3) == s2)
		{
			return i;
		}
		for (int j = 0; j < 4; j++)
		{
			s0.at(j) = s0.at(j)++;
			if (s0.at(j) > 'z')
			{
				s0.at(j) = 'a';
			}
			s1.at(j) = s1.at(j)++;
			if (s1.at(j) > 'z')
			{
				s1.at(j) = 'a';
			}
		}
		for (int j = 0; j < 3; j++)
		{
			s2.at(j) = s2.at(j)++;
			if (s2.at(j) > 'z')
			{
				s2.at(j) = 'a';
			}
		}
	}

	return -1;
}

int main()
{
	string str;
	for (; getline(cin, str);)
	{
		stringstream ss;
		ss << str;

		vector<string> w;
		string s;
		int c = -1;
		for (; ss >> s;)
		{
			w.push_back(s);
			
			if (c == -1)
			{
				c = caesar(s);
			}
		}

		for (int i = 0; i < w.size(); i++)
		{
			for (int j = 0; j < w.at(i).size(); j++)
			{
				if (w.at(i).at(j) != '.')
				{
					char sp = w.at(i).at(j) - c;
					if (sp < 'a')
					{
						int p = 'a' - sp;
						w.at(i).at(j) = 'z' - p;
					}
					else
					{
						w.at(i).at(j) = sp;
					}
				}			
			}

			cout << w.at(i) << (i == w.size() - 1 ? "" : " ");
		}

		cout << endl;
	}
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <cstring>
#include <functional>

using namespace std;

#define REP(i,a,b) for((i)=(a);(i)<(int)(b);(i)++)
#define rep(i,n) REP(i,0,n)
// BEGIN CUT HERE
#define foreach(itr,c) for(typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
template<class T> inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}
// END CUT HERE

int main(){
  string str;

  while(getline(cin,str)){
    int i, N = str.size();

    while(1){
      rep(i,N) if('a' <= str[i] && str[i] <= 'z'){
        str[i]--;
        if(str[i] < 'a') str[i] = 'z';
      }
      if(str.find("this") != -1 || str.find("the") != -1 || str.find("that") != -1){
        cout << str << endl;
        break;
      }
    }
  }

  return 0;
}

C++: #include <bits/stdc++.h>
#include <vector>
using namespace std;
string str;	
int a, b, c, d;
int main(){
	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 <string>
using namespace std;

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