Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	for scanner.Scan() {
		var result string
		line := scanner.Text()
		key := make(map[string]string)

		var i int32
		for ; i < 52; i++ {
			makeKey(key, i)
			result = decode(key, line)

			if strings.Contains(result, "the") {
				break
			} else if strings.Contains(result, "this") {
				break
			} else if strings.Contains(result, "that") {
				break
			}
		}

		fmt.Println(result)
	}
}

func makeKey(key map[string]string, shift int32) {
	for i := 'a'; i <= 'z'; i++ {
		cipher := (i + shift)
		if cipher > 'z' {
			cipher = cipher%'z' + 'a' - 1
		} else if cipher < 'a' {
			cipher = cipher + ('z' - 'a') + 1
		}
		key[string(i)] = string(cipher)
	}
}

func decode(key map[string]string, cipher string) string {
	var result string
	for _, v := range cipher {
		if key[string(v)] != "" {
			result += key[string(v)]
		} else {
			result += string(v)
		}
	}
	return result
}

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;
      }
    }
  }
}

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

int search_number(const std::string &s)
{
    const char *key = "this";
    std::string::size_type p = 0;
    while (true) {
        std::string::size_type sp = s.find(' ', p);
        if (sp == std::string::npos) break;
        if (sp - p == 4) {
            int n = s[p] - key[0];
            if (s[p + 1] - key[1] == n && s[p + 2] - key[2] == n && s[p + 3] - key[3] == n) return n;
        }
        else p = sp + 1;
    }
    return s[p] - key[0];
}

int main()
{
    std::string s;
    while (getline(std::cin, s)) {
        int n = search_number(s);
        for (unsigned i = 0; i < s.size(); ++i) {
            if (s[i] != ' ' && s[i] != ',' && s[i] != '.') {
                s[i] -= n;
                if (s[i] < 'a') s[i] += 26;
                if (s[i] > 'z') s[i] %= 26;
            }
        }
        std::cout << s << std::endl;
    }
}

C++: #include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main(){
  string str;
  int str_size;
  while(getline( cin , str )){
    str_size = str.size();
    while(1){
      for(int i=0;i<str_size;i++){
	if(str[i] == 'z')str[i]='a';
	else if(str[i] != '.' && str[i] != ' ')str[i]++;
      }
      if(str.find( "the" ) != -1)break;
      if(str.find( "that" ) != -1)break;
      if(str.find( "this" ) != -1)break;
    }
    cout << str << endl;
  }
}

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

using namespace std;

int main() { 
  string input_str;

  int shift = 1;
  while (getline(cin, input_str)) {
    for (int shift = 1; shift < 26; shift++) {
      string output_str = "";
      for (int str_i = 0; str_i < input_str.size(); str_i++) {
        char part = input_str[str_i];
        if (part >= 'a' && part <= 'z')
          part = 'a' + (part - 'a' + shift) % 26;
        output_str += part;
      }
      if (output_str.find("the") != string::npos || output_str.find("this") != string::npos || output_str.find("that") != string::npos) {
        cout << output_str << endl;
        break;
      }
    }
  }

  return 0;
}