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 <string>
#include <vector>
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <map>
#define INF 100000000

using namespace std;
typedef long long ll;

string change(string s){
    int len=s.size();
    for(int i=0;i<len;i++){
        if(s[i]=='a')s[i]='z';
        if('b'<=s[i] && s[i]<='z')s[i]--;
    }
    return s;
}

bool check(string s){
    int len=s.size();
    string tan="";
    for(int i=0;i<len;i++){
        if('a'<=s[i] && s[i]<='z'){
            tan+=s[i];
        }
        else{
            if(tan=="the" || tan=="this" || tan=="that" )return true;
            tan="";
        }
    }
    return false;
}


int main(){
    string s;
    while(getline(cin,s)){
        for(int i=0;i<26;i++){
            s=change(s);
            if(check(s)){cout<<s<<endl;break;}
        }
    }
    return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<map>
#include<queue>
#include<string>
#include<sstream>
#include<cmath>
#include<numeric>
using namespace std;


int main(){
  string alp = "abcdefghijklmnopqrstuvwxyz";
  string s;
  while( getline(cin, s) ){
    // cerr << s.size() << endl;
    bool f = false;
    int tmp = 0;
    for(int i=0; i<26; i++){

      for(int j=0; j<s.size()-4; j++){
        if( alp[ (s[j]-'a'+i)%26 ] == 't' && alp[ (s[j+1]-'a'+i)%26 ] == 'h' && alp[ (s[j+2]-'a'+i)%26 ] == 'i' && alp[ (s[j+3]-'a'+i)%26 ] == 's' ){
          f = true;
          break;
        }
        if( alp[ (s[j]-'a'+i)%26 ] == 't' && alp[ (s[j+1]-'a'+i)%26 ] == 'h' && alp[ (s[j+2]-'a'+i)%26 ] == 'a' && alp[ (s[j+3]-'a'+i)%26 ] == 't' ){
          f = true;
          break;
        }
        if( alp[ (s[j]-'a'+i)%26 ] == 't' && alp[ (s[j+1]-'a'+i)%26 ] == 'h' && alp[ (s[j+2]-'a'+i)%26 ] == 'e' ){
          f = true;
          break;
        }
        // if( s[j] == ' ' ) cerr << ' ';
        // else cerr << alp[ (s[j]-'a'+i)%26 ];
      }
      // cerr << endl;
      if( f ){
        // cerr << "  " << i << endl;
        tmp = i;
        break;
      }
    }
    // cerr << tmp << endl;

    for(int i=0; i<s.size(); i++){
      if( s[i] == ' ' || s[i] == '.' ) cout << s[i];
      else cout << alp[ (s[i] - 'a' + tmp)%26 ];
    }
    cout << endl;
  }

  return 0;
}








// EOF

C++: char*p;c[99];
main(){
    for(;~scanf("%[^\n] ",p=c);puts(c))
        for(;(*p++=*p>96?*p%96%26+97:*p)||!strstr(p=c,"th"););
}

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

bool is_valid(const std::string& s) {
	std::string str(" ");
	str.append(s);
	for (int i = 0; i < str.length(); ++i) {
		if (str.at(i) == '.') {
			str[i] = ' ';
		}
	}
	str.push_back(' ');
	
	if (str.find(" the ") != std::string::npos ||
		str.find(" this ") != std::string::npos ||
		str.find(" that ") != std::string::npos) {
		return true;
	}
	return false;
}

int main() {
	std::string str;
	std::getline(std::cin, str);
	
	std::string ans;
	const int limit = 'z' - 'a' + 1;
	for (int i = 0; i < limit; ++i) {
		for (auto c : str) {
			int elem = c + i;
			if (c >= 'a' && c <= 'z') {
				if (elem > 'z') {
					elem = 'a' + elem - ('z' + 1);
				}
				ans.push_back(elem);
			} else {
				ans.push_back(c);
			}
		}
		if (is_valid(ans)) {
			break;
		}
		ans.clear();
	}
	
	std::cout << ans << std::endl;
}

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

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

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


int checkCaesarChipher(string str1, string str2){
	int a[1000],b[1000];
	bool flag = false;
	
	for(unsigned int i=0 ; i<str1.size()-1 ; i++){
		a[i] = (str1[0] - str1[i] + 26 - 'a') % 26;
		b[i] = (str2[0] - str2[i] + 26 - 'a') % 26;
		if(a[i]==b[i]){
			flag = true;
		}else{
			flag = false;
			break;
		}
	}
	if(flag){
		return (str2[0] - str1[0]);
	}else{
		return 0;
	}
}


int main(){
	string str, hoge, key;
	char s[800];
	int j, ans;
	
	while( getline(cin,str) ){
		j=0;
		ans=0;
		for(int i=0 ; i<str.size() ; ++i){
			ans = 0;
			if( str[i] == ' ' || i==str.size()-1){
				if(i==str.size()-1){
					hoge = str.substr(j,i-j+1);
				}else{
					hoge = str.substr(j,i-j);
				}
				j = i+1;
				
				if(hoge.size()==3){
					key = "the";
					if(checkCaesarChipher( key , hoge )!=0){
						ans = checkCaesarChipher( key , hoge );
						break;
					}
				}
				if(hoge.size()==4){
					key = "that";
					if(checkCaesarChipher( key , hoge )!=0){
						ans = checkCaesarChipher( key , hoge );
						break;
					}
					key = "this";
					if(checkCaesarChipher( key , hoge )!=0){
						ans = checkCaesarChipher( key , hoge );
						break;
					}
				}
			}
		}
		if(ans!=0){
			for(int i=0 ; i<str.size() ; i++){
				if(str[i]>='a' && str[i]<='z'){
					str.at(i) -= ans;
				}
			}
			cout << str << endl;
		}
	}
	return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

int main()
{
	string S , T;
	while(getline(cin , S))for(size_t i = 0; i < 26; i++)
	{
		for(auto &x : S)if('a' <= x&&x <= 'z')if(++x > 'z')x -= 26;
		stringstream SS;
		SS << S;
		vector<string>VS;
		while(SS >> T)if(T == "the" || T == "this" || T == "that" || T == "ths." || T == "this." || T == "that.")
		{
			cout << S << endl;
			break;
		}
	}
}

C++: #include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
using namespace std;
void caesar(char *s, int n) {
  char c;
  while (c = *s) {
    if (c >= 'A' && c <= 'Z')
      *s = 'A' + (c - 'A' + n) % 26;
    if (c >= 'a' && c <= 'z') 
      *s = 'a' + (c - 'a' + n) % 26;
    s++;
  }
}
int main() {
  int n;
  char s[81];
  scanf("%80[^\n]s", s);
  for (n = 0; n < 26; n++) {
    caesar(s, 1);
    if (strstr(s, "the") || strstr(s, "this") || strstr(s, "that")) {
      cout << s << endl;
      break;
    }
  }
  return 0;
}