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 <cstdio>
using namespace std;

int main()
{
//    char c = 'x';
//    char d = '|';
//    char e = 'm';
//
//    printf("%d %d %d\n", c, d, e);
//
//    c = 't';
//    d = 'h';
//    e = 'i';
//
//        printf("%d %d %d\n", c, d, e);


    char s[80 + 7];
    char ans[80 + 7];

    while(gets(s))
    {
        int k = 0;
        for(int i = 0; s[i]; i++)
        {
            if(s[i] >= 'a' && s[i] <= 'z')
            {
                ans[k] = s[i] - 4;
                k++;
            }
            else {
                ans[k] = s[i];
                k++;
            }
        }
        ans[k] = '\0';
        puts(ans);
    }

    return 0;
}

C++: #include <iostream>

using namespace std;

int main(void) {
	char str[81];
	int shift = 0;
	while(cin.getline(str, 81)) {
		shift = 0;
		for(int i = 0; str[i] != NULL; i++) {
			if((str[i] != NULL) && (str[i+1] != NULL) && (str[i+2] != NULL) &&
				(str[i] != ' ') && (str[i+1] != ' ') && (str[i+2] != ' ')) {
					if(str[i+1] - str[i] == 'h' - 't') {
						if(str[i+2] - str[i+1] == 'e' - 'h') {
							shift = 't' - str[i];
							break;
						}
						if(str[i+3] != NULL && str[i+3] != ' ') {
							if((str[i+2] - str[i+1] == 'i' - 'h') && (str[i+3] - str[i+2] == 's' - 'i')) {
								shift = 't' - str[i];
								break;
							}
							if((str[i+2] - str[i+1] == 'a' - 'h') && (str[i+3] - str[i+2] == 't' - 'a')) {
								shift = 't' - str[i];
								break;
							}
						}
					}
			}
		}

		for(int i = 0; str[i] != NULL; i++) {
			if(str[i] != ' ' && str[i] != '.') {
				str[i] = (str[i] - 'a' + shift + ('z' - 'a' + 1)) % ('z' - 'a' + 1) + 'a';
			}
		}

		cout << str << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#define INF 1000000000

using namespace std;

// the this that

int main() {
  string str,n1="the",n2="this",n3="that";
  while (getline(cin, str)) {    
    for (int i=0; i<26; i++) {
      for (int j=0; j<3; j++) n1[j] = (n1[j]=='z')? 'a' : n1[j] + 1;
      for (int j=0; j<4; j++) n2[j] = (n2[j]=='z')? 'a' : n2[j] + 1;
      for (int j=0; j<4; j++) n3[j] = (n3[j]=='z')? 'a' : n3[j] + 1;
      if (str.find(n1)!=string::npos||str.find(n2)!=string::npos||str.find(n3)!=string::npos) {
	for (int j=0; j<str.length(); j++) {
	  if (isalpha(str[j])) {
	    str[j]=(str[j]+i)%26+'a';
	  }
	}
	break;
      }
    }
    cout << str << endl;
  }
}

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

std::string Caesar(std::string str, int tranceNum )
{
	for(size_t i=0; i<str.length(); ++i)
	{
		if(str[i]!='.')
		{
			int chNum = 0;
	
			chNum = str[i];

			chNum += tranceNum;

			chNum = (chNum-97)%26+97;
	
			str[i] = chNum;	
		
		}
	}

	return str;
}

int main(void)
{
	std::string str;
	
	std::vector<std::string> sentence;

	while(1)
	{
		std::cout << "もふり\n";
	
		while(std::cin >> str)
		{
			sentence.push_back(str);
				
			if(sentence[sentence.size()-1][sentence[sentence.size()-1].length()-1]=='.')
			{
				break;
			}
		}

		if(std::cin.eof())
		{
			break;
		}

		for(bool flg=1; flg; )
		{
			for(size_t j=0; j<sentence.size(); ++j)
			{
			sentence[j] = Caesar(sentence[j],1);	
			}
	
			for(size_t j=0; (j<sentence.size()) && flg; ++j)
			{
				switch(sentence[j].length())
				{
				case 3:
					flg = (sentence[j]=="the") ? 0 : 1;
					break;
				case 4:
					flg = (sentence[j]=="that" || sentence[j]=="this") ? 0 : 1;
					break;
				case 5:
					flg = (sentence[j]=="that." || sentence[j]=="this.") ? 0 : 1;
					break;
				default:
					break;
				}
			}
		}
		for(size_t j=0; j<sentence.size(); ++j)
		{
			std::cout << sentence[j] << ' ';
		}
		std::cout << '\n';
	
		sentence.clear();
		}
}

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

C++: char*c;a[99];main(){for(scanf("%[^\n]",a);!(strstr(a,"this")||strstr(a,"that")||strstr(a,"the"));)for(c=a;*c;c++)*c<97||(*c=(*c+8)%26+97);puts(a);}

C++: #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;
typedef pair<int, int>P;

int main() {
	string s;
	while (getline(cin, s)) {
		while (1) {
			for (char &c : s) {
				if (isalpha(c)) {
					if (c == 'z')c = 'a';
					else c++;
				}
			}
			if ((int)s.find("the") >= 0 || (int)s.find("this") >= 0 || (int)s.find("that") >= 0)break;
		}
		cout << s << endl;
	}
	return 0;
}

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

using namespace std;

int main(){
	char ciph[81];

	while(cin.getline(ciph,81)){
		int len=strlen(ciph);
		int shift=0;
		for(int j=0;j<len-2;j++){
			if(ciph[j+1]-ciph[j+0]=='h'-'t'
			&& ciph[j+2]-ciph[j+1]=='e'-'h'
			&& !islower(ciph[j+3])){
				shift=ciph[j]-'t';
				if(shift<0)	shift+=26;
				break;
			}
		}
		for(int j=0;j<len-3;j++){
			if(ciph[j+1]-ciph[j+0]=='h'-'t'
			&& ciph[j+2]-ciph[j+1]=='i'-'h'
			&& ciph[j+3]-ciph[j+2]=='s'-'i'
			&& !islower(ciph[j+4])){
				shift=ciph[j]-'t';
				if(shift<0)	shift+=26;
				break;
			}
		}
		for(int j=0;j<len-3;j++){
			if(ciph[j+1]-ciph[j+0]=='h'-'t'
			&& ciph[j+2]-ciph[j+1]=='a'-'h'
			&& ciph[j+3]-ciph[j+2]=='t'-'a'
			&& !islower(ciph[j+4])){
				shift=ciph[j]-'t';
				if(shift<0)	shift+=26;
				break;
			}
		}
		for(int i=0;i<len;i++){
			if(islower(ciph[i])){
				ciph[i]-=shift;
				if(ciph[i]<'a')	ciph[i]+=26;
			}
		}
		cout<<ciph<<endl;
	}

	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
signed main(){
        char s[100];
        while( fgets(s, 100, stdin) != NULL ){
                for(int i=0;i<25;i++){
                        for(int j=0;j<100;j++){
                                if(s[j]=='a') s[j] = 'z';
                                else if('a'<s[j]&&s[j]<='z') s[j]-=1;
                        }
                        if(strstr(s,"the")!=NULL ||
                                        strstr(s,"this")!=NULL ||
                                        strstr(s,"that")!=NULL){
                                printf("%s",s);
                                break;
                        }
                }
        }
        return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
string S;
int main() {
	while (getline(cin, S)) {
		for (int h = 0; h < 26; h++) {
			if (S.find("this") != string::npos) {
				goto E;
			}
			if (S.find("that") != string::npos) {
				goto E;
			}
			if (S.find("the") != string::npos) {
				goto E;
			}
			for (int i = 0; i < S.size(); i++) {
				if (S[i] >= 'a') {
					if (S[i] == 'z') {
						S[i] -= 25;
					}
					else {
						S[i]++;
					}
				}
			}
		}
	E:;
		cout << S << endl;
	}
}