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<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>
#define rep(i,n) for(int i=0;i<n;i++)
typedef int long long ll;

using namespace std;
int main(){

    string s;
    
    while(getline(cin,s)){
        
        for(int i=0;i<27;i++){
            for(int j=0;j<s.size();j++){
                if(s[j]=='z'){s[j]='a';}
                else if(!isalpha(s[j])){}
                else s[j]=char(s[j]+1);
            }
            if(s.find("this")!=string::npos||s.find("that")!=string::npos||s.find("the")!=string::npos){
                cout<<s<<endl;
                break;
            }
            
            
        }
        
        
    }
    
    return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include<string.h>
#include<ctype.h>
 
int main()
{
    char str[90];
     
    while( fgets( str, 81, stdin ) != 0 ){
        while( 1 ){
            for( int i = 0; i < strlen( str ); i++ ){
                if( isalpha( str[i] ) ) str[i]++;
                 
                if( str[i] > 'z' ){
                    str[i] = 'a';
                }
            }
             
            if( strstr( str, "the" ) != NULL || strstr( str, "this" ) != NULL || strstr( str, "that" ) != NULL ) break;
        }
         
        std::cout << str;
    }
 
    return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
 
int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	string str;
	getline(cin, str);
	
	while(1){
		for(size_t i = 0; i < str.size(); ++i){
			if('a' <= str[i] && str[i] <= 'z'){
				if(str[i] == 'z'){
					str[i] = 'a';
				}
				else {
					str[i]++;
				}
			}
		}
		bool check = false;
		for(size_t i = 0; i < str.size(); ++i){
			if(str[i] == 't' && (i == 0 || str[i - 1] == ' ')){
				if(str.substr(i, 3) == "the" && (str[i + 3] == ' ' || str[i + 3] == '.') ){
					check = true;
					break;
				}
				if((str.substr(i, 4) == "this" || str.substr(i, 4) == "that") && (str[i + 4] == ' ' || str[i + 4] == '.') ){
					check = true;
					break;
				}
			}
		}
		if(check){
			break;
		}
	}
	cout << str << endl;
	
	return 0;
}

C++: #include <string>
#include <vector>
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <map>
#define INF 100000000

using namespace std;
typedef long long ll;

string change(string s){
    int len=s.size();
    for(int i=0;i<len;i++){
        if(s[i]=='a')s[i]='z';
        if('b'<=s[i] && s[i]<='z')s[i]--;
    }
    return s;
}

bool check(string s){
    int len=s.size();
    string tan="";
    for(int i=0;i<len;i++){
        if('a'<=s[i] && s[i]<='z'){
            tan+=s[i];
        }
        if((s[i]<'a' && 'z'<s[i]) || i==len-1){
            if(tan=="the" || tan=="this" || tan=="that" )return true;
            tan="";
        }
    }
    return false;
}


int main(){
    string s;
    while(getline(cin,s)){
        for(int i=0;i<26;i++){
            s=change(s);
            if(check(s)){cout<<s<<endl;break;}
        }
    }
    return 0;
}

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

bool isSmallAlpha(char c){
	return 'a' <= c && c <= 'z';
}

void encode(std::string& str, int s){
	for(int i=0; i < str.size(); i++){
		if(isSmallAlpha(str[i])){
			str[i] = (str[i] - 'a' + s) % 26 + 'a';
		}
	}
}

int main() {
	std::string s;
	while(std::getline(std::cin, s)){
		for(int i = 0; i < 26; i++){
			encode(s, 1);
			if(s.find("the") != std::string::npos ||
			   s.find("that") != std::string::npos ||
			   s.find("this") != std::string::npos){
				std::cout << s << std::endl;   	
			}
		}
	}
	return 0;
}

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];
    
    for(int i=0;;i++){
        
        in = getchar();
        
        if(in==EOF){
            S[i]='\0';
            break;
        }else{
            S[i]=(char)in;
        }
    }
    
    for(int k=0;k<27;k++){
        
        bool f = false;
        
        for(int i=0;;i++){
            if('a'<=S[i] && S[i]<='y'){
                S[i]++;
            }else if(S[i]=='z'){
                S[i]='a';
            }
            
            if(i>=3 && !('a'<=S[i] && S[i]<='z')){
                if(S[i-3]=='t' && S[i-2]=='h' && S[i-1]=='e')
                    f=true;
            }
            if(i>=4 && !('a'<=S[i] && S[i]<='z')){
                if(S[i-4]=='t' && S[i-3]=='h')
                    if((S[i-2]=='i' && S[i-1]=='s') || (S[i-2]=='h' && S[i-1]=='t'))
                        f=true;
            }
            
            if(S[i]=='\0') break;
        }
        
        if(f) break;
    }
    
    for(int i=0;S[i]!='\0';i++)
        printf("%c",S[i]);
    
    return 0;
}

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

using namespace std;

int main(){

    const string keyword[] = {"the", "this", "that"};
    string str = "";

    while(getline(cin, str)){
        int len = str.length();
        vector <bool> match(3, false);

        int i,j;

        for(j=0; j<26; j++){
            string current = str;
            for(i=0; i<len; i++){
                if(isalpha(str[i])){
                        current[i] = (str[i] - 'a' + j) % 26 + 'a';
                }
            }

            for(i=0; i<3; i++){
                if(current.find(keyword[i]) != string::npos){
                    match[i] = true;
                }
            }

            if((int)count(match.begin(), match.end(), true) > 0){
                cout << current << endl;
                break;
            }
        }
    }
    return 0;
}