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>

using namespace std;

int main() {
    string s;
    int len;
    
    while (getline(cin, s)) {
        while (1) {
            len = s.size();
            for (int i = 0; i < len; i++) {
                if ('a' <= s[i] && s[i] <= 'z') {
                    if (s[i] == 'a') {
                        s[i] = 'z';
                    }
                    else {
                        s[i]--;
                    }
                }
            }
            if (s.find("the") >= 0 || s.find("this") >= 0 || s.find("that") >= 0) {
                cout << s << endl;
                break;
            }
        }
    }

    return 0;
}

C++: #include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <string>
#include <algorithm>
#include <string>
#include <climits>
#include <iomanip>
#include <utility>

#define REP(i, n) for (int (i) = 0; (i) < (int)(n); (i)++)
#define REG(i, a, b) for (int (i) = ((int)(a)); (i) < ((int)(b)); i++)
#define ALL(V) (V).begin(), (V).end()
#define PRINT(STR) cout << (STR) << endl
#define DEBUG(X) cerr << X << " (" << __LINE__ << ", " << __func__ << " )" << endl;

typedef long long ll;
using namespace std;

int main() {
	cin.tie(0); //?????±?????????????????????
	ios::sync_with_stdio(false); //printf??¨??±??????????????????
	string str;
	while (getline(cin, str)) {
		string newstr = str;
		for (int i = -26; i <= 26; i++) {
			for (int j = 0; j < str.size(); j++) {
				if (newstr[j] != ' ' && newstr[j] != '.' && newstr[j] != '\n') {
					newstr[j] = str[j] + i;
				}
			}
			if (newstr.find("the", 0) != string::npos ||
					newstr.find("this", 0) != string::npos ||
					newstr.find("that", 0) != string::npos) {
				cout << newstr << 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[80][15];
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 < 80; i++){
    for (int j = 0; j < 15; 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];
    }
  }
}

int main(){
  while (cin.getline(c, sizeof(c))){
    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;
}

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

int main(){
	std::string s;
	while(std::getline(std::cin,s)){
		while(s.find("the")==s.npos&&s.find("that")==s.npos&&s.find("this")==s.npos){
			for(int i=0;i<s.size();++i){
				if(s[i]>='a'&&s[i]<='y')s[i]++;
				else if(s[i]=='z')s[i]='a';
			}
		}
		std::cout<<s<<std::endl;
	}
	return 0;
}

C++: #include<cstring>
#include<cstdio>
#include<iostream>

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

using namespace std;


int main(){
	char a[100];

	while(NULL!=fgets( a, 80, stdin)){
		int n=strlen(a);

		while(NULL==strstr(a,"the")&&NULL==strstr(a,"this")&&NULL==strstr(a,"that")){
			REP(n){
				if('a'<=a[i] && a[i]<'z')	a[i]++;
				else if('z'==a[i]) a[i]='a';
			}
		}

	fprintf(stdout, "%s\n",a);
	}

	return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <stdlib.h>
#include <vector>

using namespace std;


int main(){

	string line;

	while(getline(cin, line)){

		string str[80], ans[80];
		int count = 0;
		int flag = 0;
		int slide;

		//???????????????
		
		string temp;
		for(int i=0 ; i<line.size()-1 ; i++){
			temp += line[i];
		}
		line = temp;
		

		//???????????????????????¨???????´?
		for(int i=0 ; i<line.size() ; i++){
			if(line[i] == ' '){
				count++;
			}else{
				str[count] += line[i];
				ans[count] = str[count];
			}
		}
		count++;


		for(int i=1 ; i<=26 ; i++){
			for(int j=0 ; j<count ; j++){
				for(int k=0 ; k<str[j].size() ; k++){
					if(str[j][k] != '.'){
						str[j][k]++;
						if(str[j][k] > 'z'){
							str[j][k] = str[j][k] - 'z' + 'a' -1;
						}
					}
					if(str[j][k] == 'h' && str[j][k-1] == 't'){
						flag = 1;
						slide = i;
						break;
					}
				}

				/*
				if(str[j] == "this" || str[j] == "the" || str[j] == "that"
						|| str[j] == "this." || str[j] == "the." ||str[j] == "that."){
					flag = 1;
					slide = i;
					break;
				}
				*/
			}
			if(flag == 1)break;
		}

		for(int i=0 ; i<count ; i++){
			for(int j=0 ; j<ans[i].size() ; j++){
				if(ans[i][j] != '.'){
					if((ans[i][j] + slide) > 'z' ){
						ans[i][j] = ans[i][j] - 'z' + 'a' + slide -1;
					}else{
						ans[i][j] = ans[i][j] + slide ;
					}
				}
			}
		}

		for(int i=0 ; i<count ; i++){
			cout << ans[i] << ' ';
		}
		cout << ans[count] << endl;

	}
	return 0;
}

C++: #include <iostream>
using namespace std;
#include <stdio.h>
#include <string.h>
#include <string>
#include <algorithm>
#include <vector>

void q17() {
	vector<string> hints;
	hints.push_back("the");
	hints.push_back("this");
	hints.push_back("that");

	vector< vector<string> > shiftHints;
	for (int i = 0; i < 26; i++) {
		vector<string> iShiftHints;
		for (int j = 0; j < hints.size(); j++) {
			string tmp = "";
			for (int k = 0; k < hints[j].length(); k++) {
				char z = ((hints[j][k] - 'a' + i) % 26) + 'a';
				tmp += ((hints[j][k] - 'a' + i) % 26) + 'a';
			}
			iShiftHints.push_back(tmp);
		}
		shiftHints.push_back(iShiftHints);
	}

	string str;
	for (; getline(cin, str);) {
		int s;
		bool flag = false;
		for (s = 0; s < 26; s++) {
			for (int i = 0; i < hints.size(); i++) {
				if (str.find(shiftHints[s][i]) != -1) {
					flag = true;
				}
			}
			if (flag) break;
		}

		string ans = "";
		for (int i = 0; i < str.length(); i++) {
			if ('a' <= str[i] && str[i]<= 'z') {
				ans += (str[i] - 'a' - s) % 26 + 'a';
			}
			else {
				ans += str[i];
			}
		}
		cout << ans << endl;
	}
}

int main() {
	q17();
	return 0;
}