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 <cstdio>
#include <algorithm>
#include <string>

using namespace std;

void caesar_decipher(string &s, int d) {
    d %= 26;
    for (char &c: s)
        if (c >= 'a' && c <= 'z') {
            c += d;
            if (c < 'a') {
                c += 26;
            } else if (c > 'z') {
                c -= 26;
            }
        }
}

bool testcase_ends() {
    char buf[128];
    if (fgets(buf, 128, stdin) == NULL)
        return 1;

    string s(buf);

    string keywords[]={"the", "this", "that"};
    auto is_valid=[&](string &s)->bool {
        for (string &kw: keywords)
            if (s.find(kw) != string::npos)
                return true;

        return false;
    };

    for (int i=0; i<26; ++i) {
        if (is_valid(s)) break;

        caesar_decipher(s, 1);
    }

    printf("%s", s.c_str());
    return 0;
}

int main() {
    int solved=0;
    while (!testcase_ends())
        ++solved;

    return !solved;
}

C++: #include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define LOOP(i,x,n) for(int i=x;i<n;i++)
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define MP make_pair
#define FR first
#define SC second
#define int long long
using namespace std;
const int MOD=1000000007;
const int INF=9000000009;

signed main(){
  string s;
  while(getline(cin,s)){
    vector<int> spe;
    REP(i,s.size())if(s[i]==' ')spe.PB(i);
    LOOP(i,1,27){
      string t;
      REP(j,s.size()-1){
        if(s[j]==' ')continue;
        if((s[j]+i)<=122){
          t+=(s[j]+i);
        }else{
          t+=((s[j]+i)-26);
        }
      }
      int f=0;
      REP(j,t.size()){
        if(t.substr(j,3)=="the"||t.substr(j,4)=="that"||t.substr(j,4)=="this"){
          int p=0;
          REP(k,t.size()){
            if(k==spe[p]-p-1){
              cout<<t[k]<<' ';
              p++;
            }else{
              cout<<t[k];
            }
          }
          cout<<'.'<<endl;
          f=1;
          break;
        }
      }
      if(f)break;
    }
  }
  return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
int main(){
	string str;int n=0; bool flag=false;
	getline(cin,str);
	for(int k=0;k<26;k++){
		for(int i=0;i<str.size();i++){
				if(str[i]-'a'<0 || str[i]-'z'>0) continue;
				else if(++str[i]-'z'>0) str[i]-=26;		
		};
		string ptr; string qtr;
		for(int i=0;i<str.size()-4;i++){
		ptr=str.substr(i,4); qtr=str.substr(i,3);
			if(ptr=="this" || ptr=="that" || qtr=="the") flag=true;
			if(flag==true) break;
		};
		if(flag==true) break;
	};
	cout << str << '\n' ;
}

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

string arrs[200];

bool judge4(const string &str) {
	int d1 = str[0] - 't';
	int d2 = str[1] - 'h';
	int d3 = str[2] - 'i';
	int d4 = str[3] - 's';
	int d5 = str[2] - 'a';
	int d6 = str[3] - 't';
	return (d1 == d2 && ((d2 == d3 && d3 == d4) || (d2 == d5 && d3 == d6)));
}

bool judge3(const string &str) {
	int d1 = str[0] - 't';
	int d2 = str[1] - 'h';
	int d3 = str[2] - 'e';
	return (d1 == d2 && d2 == d3);
}

int main() {
	cin.clear();
	int cnt = 0;
	while (!cin.eof()) {
		cin >> arrs[cnt++];
		if (cin.eof()) break;
		char ch = getchar();
		if (ch == '\n') {
			bool isOk = 0;
			int delta = 0;
			for (int i = 0; i < cnt; ++i) {
				if (arrs[i].length() == 4) {
					if (judge4(arrs[i])) {
						isOk = 1;
						delta = arrs[i][0] - 't';
						break;
					}
				}else if (arrs[i].length() == 3) {
					if (judge3(arrs[i])) {
						isOk = 1;
						delta = arrs[i][0] - 't';
						break;
					}
				}
			}
			for (int i = 0; i < cnt; ++i) {
				for (int j = 0; j < arrs[i].length(); ++j) 
					if (arrs[i][j] != '.') arrs[i][j]-= delta;
				cout << arrs[i] << ((i == cnt - 1) ? "\n" : " ");
			}
			cnt = 0;
		}
	}
	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] > 'z' ){ // zからaに飛ばす
	    s[i] = 'a';
	  }
	}
      }

      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;
	}
      }

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

C++: #include<iostream>
#include<cstring>
#include<cstdio>
using namespace std;
int main(){
	int f = 0,i;
	for(;;){
		char word[100]={0};
		for(i=0;;i++){
			if(scanf("%c",&word[i]) == EOF){f = 1;word[i]=10; break;}
			if(word[i] == 10){break;}
		}
		for(int l=0;l<26;l++){
			for(i=0;i<(int)strlen(word);i++){
				if(word[i] == 't' && word[i+1] == 'h' && word[i+2] == 'i' && word[i+3] == 's' && word[i+4] == ' '){break;}
				else if(word[i] == 't' && word[i+1] == 'h' && word[i+2] == 'a' && word[i+3] == 't' && word[i+4] == ' '){break;}
				else if(word[i] == 't' && word[i+1] == 'h' && word[i+2] == 'e' && word[i+3] == ' '){break;}
				else if(word[i] == 't' && word[i+1] == 'h' && word[i+2] == 'i' && word[i+3] == 's' && word[i+4] == '\n'){break;}
				else if(word[i] == 't' && word[i+1] == 'h' && word[i+2] == 'a' && word[i+3] == 't' && word[i+4] == '\n'){break;}
				else if(word[i] == 't' && word[i+1] == 'h' && word[i+2] == 'e' && word[i+3] == '\n'){break;}
			}
			if(i != (int)strlen(word)){cout<<word;break;}
			for(i=0;i<(int)strlen(word);i++){
				if(word[i]==122){word[i]=97;}
				else if(word[i]>=97 && word[i]<122){word[i]++;}
			}
		}
		if(f == 1){break;}
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;

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

    return 0;
}