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 <bits/stdc++.h>

//const static double	de_PI	= 3.14159265358979323846;
//const static int	de_MOD	= 1000000007;
//const static int	de_MAX	= 999999999;
//const static int	de_MIN = -999999999;

inline std::vector<std::string> Split_String(const std::string &str, const char key) {

	std::vector<std::string> result;
	std::stringstream SS(str);
	std::string temp;

	while (std::getline(SS, temp, key)) {
		result.push_back(temp);
	}

	return(result);

}

inline std::string Decode_CaesarCipher(const std::string &cryptogram, const int shift) {

	std::string temp = cryptogram;
	for (unsigned int i = 0; i < temp.length(); i++) {
		if (65 <= temp[i] && temp[i] <= 90) {
			temp[i] = temp[i] - shift;
			if (temp[i] < 65) {
				temp[i] += 26;
			}

		}
		else if (97 <= temp[i] && temp[i] <= 122) {
			temp[i] = temp[i] - shift;
			if (temp[i] < 97) {
				temp[i] += 26;
			}
		}
	}

	return(temp);
}

int main(void) {

	//std::ifstream in("123.txt");	std::cin.rdbuf(in.rdbuf());

	std::string temp, th;
	std::vector<std::string> split, len3, len4, ans;

	while (std::getline(std::cin, temp)) {

		//??????????????§?????????????????????
		split = Split_String(temp, ' ');
		
		for (unsigned int i = 0; i < split.size(); i++) {

			//?????????????????????
			if (split[i].find(".", 0) != std::string::npos) {
				split[i].erase(split[i].begin() + split[i].find(".", 0));
			}

			//3??????/?????????????????????????????????
			switch (split[i].length()) {
			case 3:len3.push_back(split[i]); break;
			case 4:len4.push_back(split[i]); break;
			}
		}

		//3??????????????¨???????????????????????????????????´???????????????????????¢???(?????????"t"????£?)
		for (unsigned int i = 0; i < len3.size(); i++) {
			for (unsigned int j = 0; j < len4.size(); j++) {
				if (len3[i].substr(0, 2) == len4[j].substr(0, 2)) {
					if (th.find(len3[i][0], 0) == std::string::npos) {
						th.push_back(len3[i][0]);
					}
				}
			}
		}

		//t????£???????????????°???????????????3??????????????§"the"?????§???????????????
		int shift = 0;
		for (unsigned int i = 0; i < th.length(); i++) {
			if ('t' <= th[i]) {
				shift = th[i] - 't';
			}
			else {
				shift = th[i] - 't' + 26;
			}
			for (unsigned int j = 0; j < len3.size(); j++) {
				if (Decode_CaesarCipher(len3[i], shift) == "the") {
					j = len3.size();
					i = th.length();
				}
			}
		}

		//???????????????????´?
		ans.push_back(Decode_CaesarCipher(temp, shift));

		//?¬???±??????
		temp.clear(); th.clear();
		split.clear(); len3.clear(); len4.clear();
	}

	//????????????
	for (unsigned int i = 0; i < ans.size(); i++) {
		std::cout << ans[i] << std::endl;
	}


}

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()){
    if(words[i].size()==3||words[i].size()==4){
      REP(j,26){
        REP(k,words[i].size()){
          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")
          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];
  cout << endl;
}

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

void next(string& str)
{
	for(int i=0; i<str.length(); i++)
	{
		if('a'<=str[i] && str[i]<'z')
		{
			str[i] = ((str[i]-'a'+25)%26)+'a';
		}
	}
}

int main()
{
	string str;
	while(getline(cin,str))
	{
		for(int i=0; i<26; ++i,next(str))
		{
			if(-1!=str.find("the") || -1!=str.find("this") || -1!=str.find("that"))
			{
				cout << str << endl;
				break;
			}
		}
	}

	return 0;
}

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

int main(){
  int index ,flag=0 ,temp= 'z' - '`' ,cnt=0;
  string s ,key[3]={ "the" ,"this" ,"that" };

  while( true ){
    flag = 0;
    getline( cin ,s );
    if( cin.eof() ){
      break;
    }

    while( true ){
      for( int i=0 ; i<s.length()+1 ; 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 ); // the ,this ,that を探す
	if( index != string::npos ){ // あった
	  cout << s << endl;
	  flag = 1;
	  break;
	}
      }
      cnt++;
      if( cnt == 26 ){
	break;
      }

      if( flag == 1 ){
	break;
      }
    }
  }
}

C++: #include <stdio.h>
#include <string.h>

void shift(char *str, int len, int n){
	char t[] = "abcdefghijklmnopqrstuvwxyz";
	char c;
	for(int i=0; i<len; ++i){
		c = *(str + i);
		if(c >= 'a' && c <= 'z'){
			str[i] = t[(c-'a'+n)%26];
		}
	}
}

int main(void){
	char input[81];
	char copy[81];
	char *token;
	int len = 0;
	int n = 0;

	while(fgets(input, 80, stdin) != NULL){
		n = -1;
		strcpy(copy, input);

		token = strtok(copy, " .\n");
		while(token != NULL && n == -1){
			len = strlen(token);
			if(len == 4){
				for(int i=0;i<26; ++i){
					shift(token, 4, 1);
					if(strcmp(token, "this")==0 ||
						strcmp(token, "that")==0){
						n = i + 1;
						break;
					}
				}
			}else if(len ==3){
				for(int i=0;i<26; ++i){
					shift(token, 3, 1);
					if(strcmp(token, "the")==0){
						n = i + 1;
						break;
					}
				}
			}
			token = strtok(NULL, " .\n");
		}
		shift(input, strlen(input), n);
		printf(input);
	}
	return 0;
}

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

void split(const std::string &s, const char *delims, std::vector<std::string> &v)
{
    std::string::size_type p = 0;
    while (true) {
        std::string::size_type sp = s.find_first_of(delims, p);
        if (sp == std::string::npos) break;
        v.push_back(std::string(s.substr(p, sp - p)));
        p = sp + 1;
    }
}

int search_number(const std::string &s)
{
    std::vector<std::string> v;
    split(s, " ,.", v);

    const char *key = "this";
    for (unsigned i = 0; i < v.size(); ++i) {
        if (v[i].size() == 4) {
            int n = v[i][0] - key[0];
            if (v[i][1] - key[1] == n && v[i][2] - key[2] == n && v[i][3] - key[3] == n) return n;
        }
    }
    return 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;
    }
}