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 <cstdio>
#include <string.h>

using namespace std;

int main()
{
	char in[81];
	char tht[3][10] = {"the","this","that"};
	int len;
	bool end;

	while(gets(in)){
		len = strlen(in);
		end = false;
		for(int i = 0; i < 26; i++){
			for(int j = 0; j < len; j++){
				if(in[j] >= 'a' && in[j] <= 'z'){
					if(in[j] == 'z'){
						in[j] = 'a';
					}
					else{
						in[j]++;
					}
				}
			}
			for(int c = 0; c < 3; c++){
				if(strstr(in,tht[c]) != NULL){
					printf("%s\n",in);
					end = true;
				}
			}
			
			if(end){
				break;
			}
		}
	}

	return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <functional>
#include <complex>

using namespace std;

const double PI=3.14159265;

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

			for(unsigned int j=0;j<s.size();j++){
				if(s[j]>='a' && s[j]<='z') s[j]=(s[j]-'a'+1)%26+'a';
			}

		}
	}
	return 0;
}

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

int checkCaesarChipher(string str1, string str2){
	int a[1000],b[1000];
	bool flag = false;
	
	for(unsigned int i=0 ; i<str1.size()-1 ; i++){
		a[i] = (str1[0] - str1[i] + 26 - 'a') % 26;
		b[i] = (str2[0] - str2[i] + 26 - 'a') % 26;
		if(a[i]==b[i]){
			flag = true;
		}else{
			flag = false;
			break;
		}
	}
	if(flag){
		return (str2[0] - str1[0]);
	}else{
		return 0;
	}
}

int main(){
	string str[400];
	int i=0, ans=0;
	while(cin >> str[i]){
		
		i++;
	}
	for(int j=0 ; j<i ; i++){
		ans = 0;
		if(str[j].size()==3){
			string hoge1 = "the";
			if(checkCaesarChipher( hoge1 , str[j] )!=0){
				ans = checkCaesarChipher( hoge1 , str[j] );
				break;
			}
		}
		if(str[j].size()==4){
			string hoge2 = "that";
			if(checkCaesarChipher( hoge2 , str[j] )!=0){
				ans = checkCaesarChipher( hoge2 , str[j] );
				break;
			}
			string hoge3 = "this";
			if(checkCaesarChipher( hoge3 , str[j] )!=0){
				ans = checkCaesarChipher( hoge3 , str[j] );
				break;
			}
		}
	}
	if(ans!=0){
		for(int j=0 ; j<i ; j++){
			for(unsigned int k=0 ; k<str[j].size() ; k++){
				if(str[j][ str[j].size()-1] != '.'){
					str[j].at(k) -= ans;
				}
			}
			cout << str[j] << " ";
		}
	}
	return 0;
}

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

string tar[] = { "the", "this", "that" };

int main()
{
	string in;
	while (getline(cin, in))
	{
		string ans;
		for (int i=0; i<26; i++)
		{
			ans = in;
			for (int k=0; k<ans.size(); k++)
			{
				if (islower(ans[k]))
				{
					int r = i - ('z' - ans[k]);
					if (r > 0)
						ans[k] = (char) ((int) 'a' + r - 1);
					else
						ans[k] = (char) ((int) ans[k] + i);
				}
			}
			if (	   ans.find(tar[0], 0) != string::npos
				|| ans.find(tar[1], 0) != string::npos
				|| ans.find(tar[2], 0) != string::npos)
				break;
		}

		cout << ans << endl;
	}
}

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

int main(){
	string a;
	char temp;
	while(getline(cin,a)){
		for(int j=0;j<26;j++){
			for(int i=0;i<a.size();i++){
				if(isalpha(a[i])){
					if(a[i] == 122){
						a[i] -= 25;
					}else{
						a[i] += 1;
					}
				}
			}
			if(a.find("the")!=string::npos || a.find("that")!=string::npos || a.find("this")!=string::npos){
				cout << a << endl;
				break;
			}
		}
		a.clear();
	}
	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=-1;
		for(int j=0;j<len-3;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-4;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-4;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<string>
using namespace std;

int main(){
	
	string str, str1;
	int valid;
	
	while(getline(cin, str)){
		valid = 0;
		for(int i=0; i<26; i++){
			for(int j=0; j<str.length(); j++){
				if(str[j] == ' ' || str[j] == '.') continue;
				if(str[j] == 'z') str[j] = 'a';
				else{
					str[j]++;
				}
			}
			
			str1 = "";
			for(int j=0; j<str.length(); j++){
				if(str[j] != ' ' && str[j] != '.') str1 += str[j];
				else{
					if(str1 == "the" || str1 == "this" || str1 == "that"){
						cout << str << endl;
						valid = 1;
						break;
					}
					else str1 = "";
				}
			}
			if(valid == 1) break;
		}
	}

	return 0;
	
}

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

using namespace std;

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

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

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