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>
int main(int argc, const char * argv[])
{
    using namespace std;
    string word;
    int i;
    while (cin >> word) {
        for (i = 0; i < word.size(); i++) {
            if (isalpha(word[i])) {
                word[i] -= 4;
            }
        }
        cout << word;
        cout << " ";
    }
    cout << endl;
    return 0;
}

C++: #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int caesar(char s[]);
bool search(char s[]);

int main(){
	char s[256];
	int i,j=0,n=10;
	while(scanf("%[^\n]",&s)!=EOF){
		while(!search(s)){
			for(i=0;s[i]!='.';i++){
				if(s[i]!=' ') s[i]++;
				if(s[i]>122) s[i]=97;
			}
		}
		printf("%s\n",s);
	}
	return 0;
}

bool search(char s[]){
	char *is,*e,*at;
	int i=0;
	char *tmp;
	is="this";e="the";at="that";
	while(s[i]!='.'){
		if(s[i]=='t'&&s[i+1]=='h'){
				if(s[i+2]=='e') return true;
				else if(s[i+2]=='i'&&s[i+3]=='s') return true;
				else if(s[i+2]=='a'&&s[i+3]=='t') return true;
		}
		i++;
	}
	return false;
}

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

using namespace std;

int main() {
	string str;
	string in;
	vector<string> s;
	//while (cin >> in) s.push_back(in);
	for (int i=0; i<(int)s.size(); i++) {
		str += s[i];
		if (i<(int)s.size()-1) str += " ";
	}
	
	str = "xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.";
	
	for (int i=0; i<26; i++) {
		if (str.find("the")!=str.npos || str.find("this")!=str.npos || str.find("that")!=str.npos) break;
		for (int j=0; j<(int)str.size(); j++) {
			if (str[j] == '.' || str[j] == ' ') continue;
			str[j] = 'a' + (str[j] - 'a' + 1)%26;
		}
	}
	
	cout << str << endl;
	
	return 0;
}

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

int main()
{
	string str;
	while(getline(cin,str)){
		int l,m;
		l = static_cast<int>(str[0] - 't');
		m = static_cast<int>(str[1] - 'h');
		if(l == m){
			for(unsigned i=0;i<str.size();i++){
				if(islower(str[i])){
					char c = static_cast<char>(static_cast<int>(str[i])-l);
					if(c<'a')
						c += 26;
					else if(c>'z')
						c-=26;
					cout << c;
				}else{
					cout << str[i];
				}
			}
			cout << endl;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<string.h>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#define li long long int
#define ld long long double
#define PI 3.1415926535897932384626
#define EPS 0.0000000001
#define rep(i,n) for(i=0;i<n;i++)
using namespace std;
typedef pair<int, int> P;

string str;
char word[6][6]={"the","this","that","the.","this.","that."};
char sent[80][80]={};
int main()
{
  bool ans=false;
  while(getline(cin,str)){
    int i=0,j=0;
    if(str.size()==0)break;
   // scanf("%*c");
    int num=0;
    for(i=0;num<str.size();i++){
      for(j=0;;j++){
	sent[i][j]=str[num];
	num++;
	if(sent[i][j]==' '){
	  sent[i][j]='\0';
	  break;
	}
	if(sent[i][j]=='\0')break;
      }
    }
    //cout<<i<<endl;
    int gap,k,l;
    
    rep(gap,26){
      rep(k,i) rep(l,strlen(sent[k])){
	if(sent[k][l]>='a' && sent[k][l]<'z')
	   sent[k][l]++;//??????????????????
	else if(sent[k][l]=='z')
	  sent[k][l]='a';
      	//cout<<sent[k][l];//debug
      }
      // cout<<endl;//debug
      rep(k,i)
	if(strcmp(sent[k],word[0])==0 || strcmp(sent[k],word[1])==0 
	   || strcmp(sent[k],word[2])==0 || strcmp(sent[k],word[3])==0 
	   || strcmp(sent[k],word[4])==0 || strcmp(sent[k],word[5])==0){
	  rep(l,i){
	    for(int a=0;a<strlen(sent[l]);a++)
	      cout<<sent[l][a];
	    if(l<i-1)
	      cout<<" ";
	    else
	      cout<<endl;
	  }
	  ans=true;
	  break;
	}
      if(ans)break;
    }
  }
}

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

C++: #include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b) - 1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)

#define PB push_back
#define INF INT_MAX/3
#define ALL(a) (a).begin(),(a).end()
#define CLR(a) memset(a,0,sizeof(a))

typedef long long int ll;

using namespace std;

int main(){

    string s[] = {"this","the","that"};
    vector<string> in;
    while(true){
	string temp;
	cin >> temp;
	if(cin.eof()) break;
	in.PB(temp);
	/*
	if(temp[temp.length()-1] == '.') {
	    in[in.size()-1].erase(in[in.size()-1].begin() + in[in.size()-1].size()-1);
	    break;
	}
	*/
    }
    bool f = false;
    int d = 1;
    REP(i,30){

	f = true;
	REP(i,in.size()) REP(j,in[i].size()){
	    if(in[i][j] == '.') continue;
	    in[i][j] = (char)( 'a' + ( (int)(in[i][j] - 'a') + d) % 28);
	}
	vector<bool> flgs(3,false);
	for(int i=0;i<in.size();i++){
	    REP(j,3){
		if(in[i] == s[j]) flgs[j] = true;
	    }
	}
	REP(i,3) if( !flgs[i]) f = false;
	if(f) break;
    }
    if(f){
	REP(i,in.size()-1) cout << in[i] << " ";
	cout << in[in.size()-1] <<  endl;
    }

    return 0;
}

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

int main(){
  int index ,flag=0 ,temp= 'z' - 'a';
  string s ,key[3]={ "the" ,"this" ,"that" };
  getline( cin ,s );
  usleep( 100000 );
  while( flag == 0 ){
    for( int i=0 ; i<s.length() ; i++ ){
      if( s[i] != '.' && s[i] != ' ' && s[i] != '\n' ){ //　記号はスルー
	s[i]--;
	if( s[i] < 'a' ){ // aからzに飛ばす
	  s[i] += temp; 
	}
      }
    }

    for( int i=0 ; i<3 ; i++ ){
      index = s.find( key[i] ,0 );
      if( index != string::npos ){
	cout << s << endl;
	flag = 1;
	break;
      }
    }
  }
}