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<bits/stdc++.h>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

int main(){
	string s;
	while(getline(cin,s)){
		int size=s.size();
		for(int j=0;;j++){
			string ex=s;
			rep(i,size){
				if(isalpha(ex[i])){
					ex[i]=(char)(((int)ex[i]-'a'+j)%26+'a');
				}
			}
			int cnt=0;
			rep(i,size-2){
				if(ex[i]=='t' && ex[i+1]=='h' && ex[i+2]=='e'){
					cnt++;
					s=ex;
					break;
				}
			}
			rep(i,size-3){
				if(ex[i]=='t' && ex[i+1]=='h' && (ex[i+2]=='i' || ex[i+2]=='a') && (ex[i+3]=='s' || ex[i+3]=='t')){
					cnt++;
					s=ex;
					break;
				}
			}
			if(cnt>=1)break;
		}
		cout<<s<<endl;
	}
	return 0;
}

C++: #include<iostream>
#include<string>
#include<cstring>
int main(){std::string s;while(std::getline(std::cin,s)){char b[81],*p,*c;c=b;strcpy(b,s.c_str());int gap=0;do{p=strtok(c," .\n");if(p!=NULL){int l=strlen(p);if(l>=3&&p[0]-p[1]=='t'-'h'){if(l==3){if(p[0]-p[2]=='t'-'e'){gap='t'-p[0];break;}}else if(l==4){if(p[0]-p[2]=='t'-'i'&&p[0]-p[3]=='t'-'s'){gap='t'-p[0];break;}else if(p[0]-p[2]=='t'-'a'&&p[0]-p[3]==0){gap='t'-p[0];break;}}}}c=NULL;}while(p!=NULL);for(std::string::iterator it=s.begin();it!=s.end();++it){if(*it!=' '&&*it!='.'&&*it!='\n'){std::cout<<static_cast<char>(*it+gap);}else{std::cout<<*it;}}}}

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