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;

void shift(string &line){
  for ( int i = 0; i < line.size(); i++ ){
    if ( line[i] == 'z' ) line[i] = 'a';
    else if ( 'a' <= line[i] && line[i] <= 'y' ){
      line[i] = (line[i]-1);
    }
  }
}
int main(){
  string line;
  while(getline(cin,line)){
    if ( cin.eof() ) break;
    while(true){
      if (line.find("the") != string::npos ||
          line.find("this") != string::npos ||
          line.find("that") != string::npos) {
        cout << line << endl;
        break;
      }
      shift(line);
    }
  }
  return 0;
}

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

using namespace std;

int main()
{
  string stro, str;
  while(getline(cin, stro)){
    for(int i = 0; i < 26; i++){
      str = stro;
      for(int j = 0; j < stro.length(); j++){
	if(str[j] >= 'a' && str[j] <= 'z')
	  if(str[j] + i > 'z')
	    str[j] += i - 26;
	  else
	    str[j] += i;
      }
      if(str.find("the") != string::npos || str.find("this") != string::npos || str.find("that") != string::npos)
	cout << str << endl;
    }
  }
}

C++: #include<iostream>
#include<string>
#include<cstring>
#include<vector>
using namespace std;
int word_search(vector<string> s,  string key){
	for(int i = 0; i < s.size(); i++){
		if(s[i].length() <= 2 || s[i].length() >= 6) continue;
		for(int j = 0; j < s[i].length() - 1; j++)
			if(s[i][j] == '.') continue;
		if(s[i][s[i].length() - 1] == '.') s[i].erase(s[i].end() - 1);
		for(int j = 0; j < 26; j++){
			string turned_word;
			for(int k = 0; k < s[i].length(); k++){
				turned_word.push_back((s[i][k] + j - 'a') % 26 + 'a');
			}
			if(turned_word == key) return j;
		}
	}
	return -1;
}
int main(){
	for(;;){
		char line[200];
		if(fgets(line, sizeof(line), stdin) == NULL) break;
		vector<string> s;
		char *token = strtok(line, " ");
		s.push_back(token);
		for(;;){
			token = strtok(NULL, " ");
			if(token == NULL) break;
			s.push_back(token);
		}
		int num;
		if(word_search(s, "the") != -1) num = word_search(s, "the");
		if(word_search(s, "this") != -1) num = word_search(s, "this");
		if(word_search(s, "that") != -1) num = word_search(s, "that");
		for(int i = 0; i < s.size(); i++){
			for(int j = 0; j < s[i].length(); j++){
				if(s[i][j] == '.' || s[i][j] == '\n') cout << s[i][j];
				else cout << (char)((s[i][j] + num - 'a') % 26 + 'a');
			}
			if(i != s.size() - 1)cout << ' ';
		}
	}
	return 0;
}

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]--;
                    }
                }
            }
            int res1 = s.find("the");
            int res2 = s.find("this");
            int res3 = s.find("that");
            if ((res1 >= 0 && res1 < 80) || (res2 >= 0 && res2 < 80) || (res3 >= 0 && res3 < 80)) {
                cout << s << endl;
                break;
            }
        }
    }

    return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cctype>
#include <cstdio>
#include <math.h>
#include <map>
#include <queue>
#include <string>
using namespace std;

char ch;
string text;

int main() {
    while(getline(cin,text)){
    	for(int i=0;i<25;i++){
    		for(int j=0;j<text.size();j++){
    			if(text[j]>='a'&&text[j]<='y')text[j]+=1;
    			if(text[j]=='z')text[j]='a';
    		}
    		int p=text.find("the"),q=text.find("this"),r=text.find("that");
    		if(p!=string::npos||q!=string::npos||r!=string::npos){
    			cout<<text<<endl;
    			break;
    		}
    	}
    }
}

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

using namespace std;

int main()
{
	string S = "";

	getline(cin, S);

	for (int i = 0; i < 26; i++)
	{
		if (!(S.find("this") == S.npos && S.find("that") == S.npos && S.find("the") == S.npos))
		{
			cout << S;
		}

		for (string::size_type j = 0; j < S.size(); j++)
		{
			if (isalpha(static_cast<int>(S[j])))
			{
				if (S[j] == 'z')
				{
					S[j] = 'a';
				}
				else
				{
					S[j]++;
				}
			}
		}
	}

	return 0;
}

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

using namespace std;

int main(int argc, char **argv)
{
	char a[82], t;
	int n, p;
	
	while(gets(a)!=NULL){
		n = strlen(a);
		for(int i = 0; i < n; i++){
			p = (int)(a[i++]-'t');
			if(a[i] == ' '){
				continue;
			}
			t = a[i++]-p;
			if(t < 'a'){
				t += 25;
			} else if(t > 'z'){
				t -= 25;
			}
			if(a[i] == ' '){
				continue;
			}
			if(t == 'h'){
				t = a[i++]-p;
				if(t < 'a'){
					t += 25;
				} else if(t > 'z'){
					t -= 25;
				}
				if(t == 'e' && a[i] == ' '){
					break;
				} else if(t == 'i'){
					t = a[i++]-p;
					if(t < 'a'){
						t += 25;
					} else if(t > 'z'){
						t -= 25;
					}
					if(t == 's' && a[i] == ' '){
						break;
					}
				} else if(t == 'a'){
					t = a[i++]-p;
					if(t < 'a'){
						t += 25;
					} else if(t > 'z'){
						t -= 25;
					}
					if(t == 't' && a[i] == ' '){
						break;
					}
				}
			}
		}
		
		for(int i = 0; i < n; i++){
			if(a[i] == ' ' || a[i] == '.' || a[i] == ','){
				printf("%c",a[i]);
			} else {
				t = a[i]-p;
				if(t < 'a'){
					t += 25;
				} else if(t > 'z'){
					t -= 25;
				}
				printf("%c",t);
			}
		}
		cout << endl;
	}
	
	return 0;
}