Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

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 {
		infos := strings.Split(nextString(), " ")
		plain := make([]string, len(infos))
		if len(infos) == 0 {
			break
		}
		// 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 <cassert>
#include <iostream>
#include <string>

bool IsValid(const std::string& Text)
{
    return 
        Text.find("the")  != std::string::npos ||
        Text.find("this") != std::string::npos ||
        Text.find("that") != std::string::npos;
}
std::string RotateChar(const std::string& Code, int Key)
{
    std::string Text = Code;
    for(std::size_t i = 0; i < Text.size(); ++i){
        if(Text[i] == ','
        || Text[i] == '.'
        || Text[i] == ' '){
            continue;
        }
        int c = Text[i] + Key;
        if(c < 'a') c += 26;
        if(c > 'z') c -= 26;
        Text[i] = c;
    }
    return Text;
}
std::string Decrypt(const std::string& Code)
{
    for(int i = 0; i < 26; ++i){
        std::string Text = RotateChar(Code, i);
        if(IsValid(Text)){
            return Text;
        }
    }

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

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

C++: #include<stdio.h>
#include<string.h>

int main(void){
	
	char ango[1000],ttt[100];
	int leng,b;

	while(gets(ango)!=0){
		leng=strlen(ango);
		b=1;

		while(b){

			for(int i=leng-1;i>=0;i--){
				if(ango[i]>=97&&ango[i]<=122){
					ango[i]=ango[i]-1;
					if(ango[i]==96){
						ango[i]=122;
					}
				}
			}

			for(int i=0,j=0;i<=leng;i++,j++){
				if(ango[i]>=97&&ango[i]<=122&&i!=leng){
					ttt[j]=ango[i];
				}
				else{
					if((ttt[0]=='t'&&ttt[1]=='h'&&ttt[2]=='e'&&j==3)||(ttt[0]=='t'&&ttt[1]=='h'&&ttt[2]=='i'&&ttt[3]=='s'&&j==4)||(ttt[0]=='t'&&ttt[1]=='h'&&ttt[2]=='a'&&ttt[3]=='t'&&j==4)){
						b=0;
						break;
					}
					j=-1;
				}
			}
		}
		printf("%s\n",ango);
	}
	return 0;
}

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

using namespace std;

string doCaesar ( string s, int n )
{
	for (int i = 0, I = s.size(); i < I; ++i) {
		if (s[i] < 'a' || 'z' < s[i]) { continue; }
		s[i] = (s[i] - 'a' + n) % 26 + 'a';
	}
	return s;
}

int main ( void )
{
	string S[] = { "the", "the.", "this", "this.", "that", "that." };

	istringstream iss;
	string s;

	while (getline(cin, s)) {
		bool hit = false;
		for (int i = 0; i < 26 && !hit; ++i) {
			string t;
			iss.clear();
			iss.str(doCaesar(s, 26-i));
			while(iss >> t && !hit) {
				for (int w = 0, W = sizeof(S)/sizeof(string); w < W && !hit; ++w) {
					if (S[w] == t) {
						hit = true;
					}
				}
			}
			if (hit) {
				cout << doCaesar(s, 26-i) << endl;
			}
		}
	}

	return 0;
}

C++: #define _USE_MATH_DEFINES

#include <iostream>
#include <string>
#include <vector>
#include <math.h>

using namespace std;

int main(){
	string str;

	while( getline(cin, str) ){
		bool flag = 0;
		while(!flag){
			for(int i=0;i<str.size();i++){
				if(str[i]>='a' && str[i]<='z'){
					str[i]=(char)(str[i]+1);
					if(str[i]>'z'){
						str[i]-=('z'-'a'+1);
					}
				}
			}
			if(str.find("the")!=string::npos || str.find("this")!=string::npos || str.find("that")!=string::npos ){
				flag = 1;
			}
			//cout << str << endl;
		}
		cout << str << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <list>
#include <map>
#include <algorithm>
#include <stack>
#include <string>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>

using namespace std;


int main(){
	string tmp;
	string key[] = {"the","this","that"};
	int alfabet = 26;
	bool clearFlag = false;
	while(getline(cin,tmp)){

		while(alfabet--){

			for(string::iterator it = tmp.begin(); it != tmp.end(); it++){
				if(*it >= 'a' && *it <= 'z'){
					(*it)++;
					if(*it >= 'z'){
						*it = 'a';
					}
				}
			}
			for(int j = 0; j < 3; j++){
				if(tmp.find(key[j]) != string::npos){
					cout << tmp << endl;
					clearFlag = true;
					break;
				}
			}

			if(clearFlag == true){
				break;
			}

		}

	}
	return 0;
}

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

using namespace std;

int main(void){
	
	while( true ) {
		if( cin.eof() ) break;
		string str;
		string ans;
		getline( cin, str );

		for( int i = 0; i < 26; i++ ) {
			string newstr;
			newstr = str;
			for( int j = 0; j < str.length(); j++ ) {
				if( str[j] < 'a' || str[j] > 'z' ) continue;
				else {
					newstr[j] = ( str[j] - 'a' + i ) % 26 + 'a';
				}
			}
			if( newstr.find("the") != string::npos || newstr.find("this") != string::npos || newstr.find("that") != string::npos ) {
				ans = newstr;
				break;
			}
		}
		cout << ans << endl;
	}

	
    return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

typedef unsigned long long ull;
#define loop(i,a,b) for(int i=(a);i<ull(b);++i)
#define rep(i,n) loop(i,0,n)
#define all(a) (a).begin(), (a).end()

const double eps = 1e-10;
const double pi  = acos(-1.0);
const double inf = (int)1e8;

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

C++: #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#include <ctype.h>

#define GETSTR(p)       do{ fgets((p), sizeof(p), stdin); } while(0)
#define CHOMP(p)        do{ char *_q = (p) + strlen(p)-1; if(*_q == '\n') *_q = 0;            } while(0)

int main(void){
    char buf[100];
    GETSTR(buf);
    CHOMP(buf);
    int len = strlen(buf);

    const int nn = 'z' - 'a' + 1;

    while(1){
        for(int i = 0; i < len; i++){
            if(isalpha(buf[i])){
                buf[i] = 'a' + (buf[i] - 'a' + nn - 1) % nn;
            }
        }
        char buf2[100];
        sprintf(buf2, " %s ", buf);
        int l = strlen(buf2);
        for(int i = 0; i < l; i++){
            if(! isalpha(buf2[i])) buf2[i] = ' ';
        }
        if(strstr(buf2, " the ") != nullptr) break;
        if(strstr(buf2, " this ") != nullptr) break;
        if(strstr(buf2, " that ") != nullptr) break;
    }
    puts(buf);

    return 0;
}