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 <stdio.h>
int check(int a,int b,int c,int d)
{
    //printf("[%d][%d][%d][%d]\n",a,b,c,d);
    if(a != 14)return 0;
    else if(b == 23 && c == 0)return 1;
    else if(b == 1 && c == 10 && d == 0)return 1;
    else if(b == 19 && c == 19 && d == 0)return 1;
    else return 0;
}

int main()
{
    int longth,mem = 0;
    while(1)
    {
        char str[90] = {0};
        int mem1[90] = {0},mem2[90] = {0};
        if(scanf("%c",&str[0]) == -1)return 0;
        if(str[0] >= 'a' && 'z' >= str[0])mem1[0] = str[0] - 'a' + 1;
        for(int i = 1; i < 80; i++)
        {
            scanf("%c",&str[i]);
            if(str[i] == '\n')break;
            longth = i;
            if(str[i] >= 'a' && 'z' >= str[i])mem1[i] = str[i] - 'a' + 1;
        }
        for(int i = 0; i < longth; i++)
        {
            if(mem1[i] == 0);
            else if(mem1[i + 1] != 0)
            {
                if(mem1[i] <= mem1[i + 1])mem2[i] = mem1[i + 1] - mem1[i];
                else mem2[i] = 26 - mem1[i] + mem1[i + 1];
            }
        }
        /*for(int i = 0; i < longth; i++)
        {
            printf("[%d]",mem2[i]);
        }
        printf("\n");*/
        for(int i = 0; i < longth; i++)
        {
            if(mem2[i] == 0) ;
            else if(i == 0)/*printf("[%d]\n",i);*/if(check(mem2[i],mem2[i + 1],mem2[i + 2],mem2[i + 3]))if(mem1[i] <= 20)mem = 20 - mem1[i];else mem = 26 - mem1[i] + 20;
            else if(mem2[i - 1] == 0)/*printf("{%d}\n",i);*/if(check(mem2[i],mem2[i + 1],mem2[i + 2],mem2[i + 3]))if(mem1[i] <= 20)mem = 20 - mem1[i];else mem = 26 - mem1[i] + 20;
            //else printf("no\n");
        }
        //printf("{{%d}}\n",mem);
        for(int i = 0; i < longth + 1; i++)
        {
            if(str[i] >= 'a' && 'z' >= str[i])printf("%c",(str[i] - 'a' + mem) % 26 + 'a');
            else printf("%c",str[i]);
        }
        printf("\n");
    }
}

C++: #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cctype>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<bitset>
#include<utility>
#include<string>

using namespace std;

main(){
  int n,i,j,l,temp;
  string b;
  while(getline(cin,b)){
    while(1){
      for(i=0;i<b.size();i++){
	if(isalpha(b[i])){
	  if(b[i]=='z'){
	    b[i]='a';
	  }
	  else{
	    b[i]=b[i]+1;
	  }
	}
      }
      if(b.find("the")!=-1 || b.find("that")!=-1 || b.find("this")!=-1){
	cout << b <<endl;
	break;
      }
    }
  }
}

C++: // 2014/02/08 Tazoe

#include <iostream>
#include <string>
using namespace std;

int main()
{
	while(true){
		string S;
		getline(cin, S);

		if(cin.eof())
			break;

		while(true){
			for(int i=0; i<S.size(); i++){
				if(S[i]=='z'){
					S[i] = 'a';
				}
				else if('a'<=S[i] && S[i]<='y'){
					S[i] = S[i]+1;
				}
			}

			if(S.find("the", 0)!=string::npos || S.find("this", 0)!=string::npos || S.find("that", 0)!=string::npos)
				break;
		}

		cout << S << endl;
	}

	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<string>
#include<sstream>
#include<vector>
using namespace std;
signed main(){
        char s[100];
        while( fgets(s, 100, stdin) != NULL ){
                vector<string> words;
                istringstream stream(s);
                string word;
                while(getline(stream, word, ' ')) words.push_back(word);
                int d;
                for(auto w: words){
                        if(w.length()==3 &&
                                        ((int)w[0] - (int)w[1] == (int)'t' - (int)'h') &&
                                        ((int)w[1] - (int)w[2] == (int)'h' - (int)'e')){
                                d = (int)w[0] -'t';
                                break;
                        }else if(w.length()==4 &&
                                        ((int)w[0] - (int)w[1] == (int)'t' - (int)'h') &&
                                        ((int)w[1] - (int)w[2] == (int)'h' - (int)'i') &&
                                        ((int)w[2] - (int)w[3] == (int)'i' - (int)'s')){
                                d = (int)w[0] -'t';
                                break;
                        }else if(w.length()==4 &&
                                        ((int)w[0] - (int)w[1] == (int)'t' - (int)'h') &&
                                        ((int)w[1] - (int)w[2] == (int)'h' - (int)'a') &&
                                        ((int)w[2] - (int)w[3] == (int)'a' - (int)'t')){
                                d = (int)w[0] -'t';
                                break;
                        }
                }
                for(unsigned int i=0; i<100 && s[i]!=0;i++){
                        char c=s[i];
                        if('a'<=c&&c<='z') printf("%c",(char)(c-d));
                        else if(c=='.'||c==' ') printf("%c",c);
                }
                printf("\n");
        }
        return 0;
}

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<cstring>
#include<utility>
#include<set>
#include<stack>
#include<complex>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define CC puts("-------ok--------");
#define all(in) in.begin(), in.end()
#define bv vector<bool>
using namespace std;
typedef pair<int, int>PI;
using namespace std;
#define MAX  999999
int main(){
    string s;
    getline(cin,s);
    rep(i,26){
        rep(j,s.size()){
            if(s[j]>='a'&&s[j] <='z')
                (s[j] == 'z') ? s[j] ='a' : s[j] = s[j]+1;
        }
        
        if(s.find("this")!= string::npos){cout<<s<< endl;}
        else if(s.find("that")!= string::npos){cout<<s<< endl;}
        else if(s.find("the")!= string::npos){cout<<s<< endl;}
        }
    return 0;
}

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

using namespace std;

int main() {
	// the, this, thatの後はスペースと仮定する
	const string str_the("the "), str_this("this "), str_that("that ");
	string line;
	while (getline(cin, line)) {
		while (true) {
			auto result_the = line.find(str_the, 0);
			auto result_this = line.find(str_this, 0);
			auto result_that = line.find(str_that, 0);
			if (string::npos != result_the || string::npos != result_this
				|| string::npos != result_that) {
				break;
			}
			for (auto& x : line){
				char result;
				if (x >= 'a' && x < 'z') {
					++x;
				}
				else if (x == 'z') {
					x = 'a';
				}
			}
		}

		cout << line << endl;
	}
	return 0;
}