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<cctype>
#include<cstring>
char str[1000000] = {0};
using namespace std;
int main(){
    int f = 0;
    while(scanf("%[^\n]",str)!=EOF){
        fflush(stdin);
        for(int i = 0;i <= 25; i++){
            for(int j = 0;j < strlen(str); j++){
                if(str[j] == ' ' || str[j] == '.')continue;
                str[j]++;
                if(str[j] > 122)str[j] = str[j]-26;
            }
            for(int j = 0;j < strlen(str); j++){
                if(str[j] == 't' && str[j+1] == 'h' && str[j+2] == 'e')goto hoge;
                if(str[j] == 't' && str[j+1] == 'h' && str[j+2] == 'i' && str[j+3] == 's')goto hoge;
                if(str[j] == 't' && str[j+1] == 'h' && str[j+2] == 'a' && str[j+3] == 't')goto hoge;
            }
        }
        for(int i = 0;i < strlen(str); i++){
            if(str[i] == ' ' || str[i] == '.')continue;
            str[i] -= 25;
        }
        for(int i = 0;i <= 25; i++){
            for(int j = 0;j < strlen(str); j++){
                if(str[j] == ' ' || str[j] == '.')continue;
                str[j]--;
                if(str[j] < 97)str[j] = str[j]+25;
            }
            for(int j = 0;j < strlen(str); j++){
                if(str[j] == 't' && str[j+1] == 'h' && str[j+2] == 'e')goto hoge;
                if(str[j] == 't' && str[j+1] == 'h' && str[j+2] == 'i' && str[j+3] == 's')goto hoge;
                if(str[j] == 't' && str[j+1] == 'h' && str[j+2] == 'a' && str[j+3] == 't')goto hoge;
            }
        }
        hoge:
        printf("%s\n",str);
        memset(str,0,sizeof(str));
    }
    return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
using namespace std;
string caesar(string str,int num){
	string ret;
	char c;
	for(int i=0;i<str.size();i++){
		c=str[i]+(num-26);
		if(c<'a') c+=26;
		ret+=(char)c;
	}
	return ret;
}

char caesarc(char c,int num){
	c+=(num-26);
	if(c<'a') c+=26;
	return c;
}

int main(){
	string str,sts;
	vector<string> ary;
	getline(cin,str);
	bool hog[3];
	string tes[3];
	int j;
	for(int i=0;i<26;i++){
		hog[0]=hog[1]=hog[2]=false;
		sts="";
		j=0;
		tes[0]=caesar("this",i);
		tes[1]=caesar("that",i);
		tes[2]=caesar("the",i);
		while(j<str.size()){
			sts="";
			while(str[j]!=' '&&str[j]!='.'){
				sts+=str[j];
				j++;
			}
			for(int k=0;k<3;k++){
				if(tes[k]==sts) hog[k]=true;
			}
			j++;
		}
		if(hog[0]&&hog[1]&&hog[2]){
			for(int k=0;k<str.size();k++){
				if('a'<=str[k]&&str[k]<='z'){
					cout<<caesarc(str[k],26-i);
				}
				else cout<<str[k];
			}
			cout<<endl;
			break;
		}
	}
	return 0;
}

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

int main(){
    
    int zure;
    string str,the,thi,tha;
    
    the = "the";
    thi = "this";
    tha = "that";
    while(getline(cin,str)){
        for(int i=0;i<26;i++){
            
            for(int j=0;j<4;j++){
            
                if(j < 3) the[j] = 'a'+(the[j]-'a'+1)%26;
                thi[j] = 'a'+(thi[j]-'a'+1)%26;
                tha[j] = 'a'+(tha[j]-'a'+1)%26;
            
                if(str.find(the) != string::npos || str.find(thi) != string::npos || str.find(tha) != string::npos){
                    zure = (the[0]-'t'+26)%26;
                }
            
            }
        
        }
    
        for(int i=0;i<str.size();i++){
            if('a' <= str[i] && str[i] <= 'z'){
                str[i] = str[i]-zure;
                if(str[i] < 'a') str[i] += 26;
            }
        }
        cout << str << endl;
    }
    return(0);
}

C++: #include <iostream>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <map>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,b) FOR(i,0,b)
#define PB push_back
#define MP make_pair
char rec(char x,int s){
  if(x-s<'a')return x-s+26;
  return x-s;
}
int main(){
  string s[80];
  int k=0,l=0;
  while(cin>>s[k]){
    int y=s[k][0]-'t';
    if(s[k].size()==3){
      if(rec(s[k][1],y)=='h'&&rec(s[k][2],y)=='e')l=y;
    }
    if(s[k].size()==4){
      if(rec(s[k][1],y)=='h'&&rec(s[k][2],y)=='a'&&rec(s[k][3],y)=='t')l=y;
      else if(rec(s[k][1],y)=='h'&&rec(s[k][2],y)=='i'&&rec(s[k][3],y)=='t')l=y;
    }
    k++;
  }
  for(int i=0;i<k;i++){
    for(int j=0;j<s[i].size();j++){
      if(s[i][j]=='.')cout<<'.';
      else cout<<rec(s[i][j],l);
    }
    if(i==k-1)cout<<endl;
    else cout<<" ";
  }
}