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>
#include <algorithm>
#include <math.h>
#include <vector>
#include <set>

using namespace std;
typedef long long LL;
static const double EPS = 1e-9;

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n) 

int main(void){  
  vector<string> words;
  string bf;
  int s = 0;
  while(cin>>bf) words.push_back(bf);
  REP(i,words.size()){
    REP(j,26){
      REP(k,words[i].size()){
        if(words[i][k] >= 'a' && words[i][k] <= 'z' )
        words[i].replace(k, 1, 1,
              'a' + ( words[i][k] + 1 - 'a')%('z'-'a'+1) );
        
        if(words[i] == "the"||words[i] == "this" || words[i] == "that" ||
           words[i] == "the." || words[i] == "this." || words[i] == "that." )
          s = j;
      }
    }
  }
  REP(i,words.size())
    REP(j,words[i].size())
      if(words[i][j] >= 'a' && words[i][j] <= 'z' )
        words[i].replace(j, 1, 1, 'a' + (words[i][j] + s+1 - 'a')%('z'-'a'+1) );
  cout << words[0];
  FOR(i,1,words.size())
    cout << " " << words[i];
}

C++: #define	_USE_MATH_DEFINES
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cfloat>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <string>
#include <set>
using namespace std;
int main(){
	
	string s;
	while(getline(cin,s)){
		for(int i=0;i<26;i++){
			for(int j=0;j<s.size();j++){
				if(s[j]>='a'&&s[j]<='y'){
					s[j]++;
				}
				else if(s[j]=='z')
					s[j]='a';
			}
			if(s.find("the")!=string::npos||s.find("this")!=string::npos||s.find("that")!=string::npos){
				cout<<s<<endl;
				break;
			}
			
		}
	}
	
	
	
}

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[] = {"the","this","that"};
    string in;
    while(true){
	getline(cin,in);
	if(cin.eof()) break;
	bool f = false;
	int d = 1;
	REP(i,30){

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

    return 0;
}

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

int main(void){
  string s;
  string a[3] = {"this","the","that"};
  getline(cin,s);
  vector<string> ss;
  string n = "";
  s += " ";
  for(int i = 0  ; i < s.size() ; i ++){
    if(s[i] == ' '){
      ss.push_back(n);
      n = "";
    }else{
      n += s[i];
    }
  }
  bool ans = true;
  while(ans){
    for(int i = 0 ; i < ss.size() ; i ++){
      for(int j = 0 ; j < ss[i].size() ; j ++){
	ss[i][j] ++;
      }
      //cout<<ss[i]<<" ";
      for(int j = 0 ; j < 3 ; j ++){
	if(ss[i] == a[j]) ans = false;
	break;
      }
    }
  }
  for(int i = 0 ; i < ss.size() ; i ++){
    cout<<ss[i]<<" "; 
  }
  cout<<endl;
}

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;
  if(x-s>'z')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)=='s')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<<" ";
  }
}

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

int main() {
	string str; 
	while (getline(cin, str)) {
		for (int i = 0; i < 26; i++) {
			for (auto &itr : str) if (isalpha(itr)) itr = (itr - 'a' + 1) % 26 + 'a';
			if (str.find("the") != -1) { cout << str << endl; break; }
			if (str.find("this") != -1) { cout << str << endl; break; }
			if (str.find("that") != -1) { cout << str << endl; break; }
		}
	}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<cmath>
#include<vector>
#include<list>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<string>
#include<utility>
#include<algorithm>
#include<functional>
#include<deque>
#include<string.h>
#include<ctype.h>
#include<time.h>
#include<stdlib.h>
using namespace std;

char c[80], word[40][10];
int p = 0, q = 0;

bool search_th(){
  for (int i = 0; i <= p; i++){
    if (word[i][0] == 't' && word[i][1] == 'h'){
      if (word[i][2] == 'e' || (word[i][2] == 'i' && word[i][3] == 's') || (word[i][2] == 'a' && word[i][3] == 't')){
        return true;
      }
    }
  }
  return false;
}

void split_words(){
  for (int i = 0; i < 40; i++){
    for (int j = 0; j < 10; j++){
      word[i][j] = '\0';
    }
  }
  for (int i = 0; i < strlen(c); i++){
    if (c[i] >= 'a' && c[i] <= 'z'){
      word[p][q++] = c[i];
    } else {
      p++;
      word[p++][0] = c[i];
      q = 0;
    }
  }
  for (int i = 0; i <= p; i++){
    printf("word[%d]:%s\n", i, word[i]);
  }
}

int main(){
  while (cin.getline(c, sizeof(c))){
    p = 0;  q = 0;
    split_words();
    while (1){
      if (search_th() == true){
        for (int i = 0; i <= p; i++){
          cout << word[i];
        }
        puts("");  break;
      } else {
        for (int i = 0; i <= p; i++){
          for (int j = 0; j < strlen(word[i]); j++){
            if (word[i][j] >= 'a' && word[i][j] <= 'y') word[i][j]++;
            if (word[i][j] == 'z')                      word[i][j] = 'a';
          }
        }
      }
    }
    for (int i = 0; i < 80; i++){
      c[i] = '\0';
    }
  }
  return 0;
}