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 <string.h>
using namespace std;
int main(){
	string alpha = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz";
	while( 1 ){
		string 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>

using namespace std;

string answer;

bool saiki( int advance, string target )
{
	for( int i = 0;i < target.size();i++ ){
		if( target[i] >= 'a' && target[i] <= 'z' ){target[i]+=advance; if( target[i] < 'a' || target[i] > 'z' ) return false;}
	}
	if( target.find( "the" ) != string::npos || target.find( "that" ) != string::npos || target.find( "this" ) != string::npos ){ answer = target;return true;  }
	else return saiki( advance, target );
}

int main(int argc, char const* argv[])
{
	string str;

	while( getline( cin, str ) ){
		if(saiki( 1 ,str )){
			cout << answer << endl;
			continue;
		}
		if( saiki( -1 , str ) ){
			cout << answer << endl;
			continue;
		}
	}
	return 0;
}

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 i = 0; s[i] != '\0'; i++){
				if(s[i] >= 97 && s[i] <= 122) s[i] = (s[i] - 97 + 1) % 26 + 97;
			}
			if(s.find("the", 0) != string::npos || s.find("this", 0) != string::npos || s.find("that", 0) != string::npos){
				cout << s << endl;
				break;
			}
		}
	}
	return 0;
}

C++: //0017 Caesar Chipher

//es²ÆÉAAt@xbgAXy[XAsIhAüsªÜÜêéÅå80¶Ì¶ñª^¦çêé
//µ½ÃÉÍAthe,this,thatÌ¢¸ê©ªK¸ÜÜêé
//EOFªüÍ³êéÜÅAµ½¶ñðoÍ¹æ

#include<iostream>
#include<string>
#include<cctype>
using namespace std;

int main(void)
{
	string str;
	//óàÜÞêsð¾é½ßÉgetline()AÈºcin.getline(str)ªÅ«È¢ñ¾
	while( getline(cin, str) )
	{
		int i;
		int s = str.size();
		const string::size_type N = string::npos;
		while( str.find("the")==N && str.find("this")==N && str.find("that")==N )
		{
			for(i = 0; i < s; i++)
			{
				if(isalpha(str[i]))
				{
					str[i] = (str[i]-'a'+1)%26+'a';
				}
			}
		}
		cout << str << endl;
	}
	return 0;
}

C++: #include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;

//// < "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\a.txt" > "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\b.txt"


int main() {
	string st;
	vector<string>ths{ "the","this","that" };
	int a; cin >> a;
	while (getline(cin, st)) {
		for (int i = 1; i < 26; ++i) {
			string nextst(st);
			for (auto&c : nextst) {
				int n = c - 'a';
				if (n < 0 || n >= 26)continue;
				n += i;
				n %= 26;
				c = 'a' + n;
			}
			bool ok = false;
			for (auto th : ths) {
				if (nextst.find(th) != -1)ok = true;
			}
			if (ok) {
				cout << nextst << endl;
				break;
			}
		}
	}
	return 0;
}

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

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    string str;
    while(getline(cin, str)) {
        for(int i=0; i<25; i++) {
            if(str.find("the")!=string::npos) break;
            if(str.find("this")!=string::npos) break;
            if(str.find("that")!=string::npos) break;
            for(int i=0, l=str.length(); i<l; i++) {
                if(str[i]=='z') str[i]='a';
                else if(islower(str[i])) ++str[i];
            }
        }
        cout<<str<<'\n';
    }
    return 0;
}

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

using namespace std;


int main(){

	string line;

	while(getline(cin, line)){

		string str[80], ans[80];
		int count = 0;
		int flag = 0;
		int slide;

		//???????????????
		/*
		string temp;
		for(int i=0 ; i<line.size()-1 ; i++){
			temp += line[i];
		}
		line = temp;
		*/
		

		//???????????????????????¨???????´?
		for(int i=0 ; i<line.size() ; i++){
			if(line[i] == ' '){
				count++;
			}else{
				str[count] += line[i];
				ans[count] = str[count];
			}
		}
		count++;


		for(int i=1 ; i<=26 ; i++){
			for(int j=0 ; j<count ; j++){
				for(int k=0 ; k<str[j].size() ; k++){
					if(str[j][k] >= 'a' && str[j][k] <= 'z'){
						str[j][k]++;
						if(str[j][k] > 'z'){
							str[j][k] = str[j][k] - 'z' + 'a' -1;
						}
					}
					if(str[j][k] == 'h' && str[j][k-1] == 't'){
						flag = 1;
						slide = i;
						break;
					}
				}

				/*
				if(str[j] == "this" || str[j] == "the" || str[j] == "that"
						|| str[j] == "this." || str[j] == "the." ||str[j] == "that."){
					flag = 1;
					slide = i;
					break;
				}
				*/
				if(flag == 1)break;
			}
			if(flag == 1)break;
		}

		for(int i=0 ; i<count ; i++){
			for(int j=0 ; j<ans[i].size() ; j++){
				if(ans[i][j] >= 'a' && ans[i][j] <= 'z'){
					if((ans[i][j] + slide) > 'z' ){
						ans[i][j] = ans[i][j] - 'z' + 'a' + slide -1;
					}else{
						ans[i][j] = ans[i][j] + slide ;
					}
				}
			}
		}

		//cout << ans[0] << endl;

		for(int i=0 ; i<=count ; i++){
			cout << ans[i];
			if(i < count) cout << ' ';
		}
		cout << endl;

	}
	return 0;
}