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 <regex>

std::string decrypto(std::string str) {
    using namespace std;
    regex pattern(".*(the|this|that).*");
    smatch sm;
    for (int c = 0; c < 'z' - 'a' + 1; ++c) {
        for (size_t i = 0; i < str.size(); ++i) {
            if ('a' <= str[i] && str[i] <= 'z') {
                if (str[i] == 'z') {
                    str[i] = 'a';
                } else {
                    str[i] += 1;
                }
            }
        }
        //if (regex_match(str, sm, pattern)) {
        if (str.find( "the" ) != string::npos || str.find( "this" ) != string::npos || str.find( "that" ) != string::npos) {
            return str;
        }
    }
    return string("");
}

int main() {
    std::string str;
    while (std::getline(std::cin, str)) {
        std::cout << decrypto(str) << std::endl;
    }
}

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

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

C++: #include <bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    int k,i,n,x;
    char c;
    while(getline(cin,s)){
        n=s.length();
        for(i=0;i<n;i++){
            if(islower(s[i])){
                k=s[i]-'a';
                k=k-4;
                if(k<0) k=k+26;
                c='a'+k;
                cout<<c;
            }
            else cout<<s[i];
        }
        cout<<endl;
    }
}

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

int main(){
	
	string str, str1;

	while(getline(cin, str)){
		for(int i=0; i<26; i++){
			for(int j=0; j<str.length(); j++){
				if(str[j] == ' ' || str[j] == '.') continue;
				if(str[j] == 'z') str[j] = 'a';
				else{
					str[j] = str[j] + 1;
				}
			}
			
			str1 = "";
			for(int j=0; j<str.length(); j++){
				if(str[j] != ' ') str1 += str[j];
				else{
					if(str1 == "the" || str1 == "this" || str1 == "that"){
						cout << str << endl;
						return 0;
					}
					else str1 = "";
				}
			}
		}
	}

	return 0;
	
}

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

int main(int argc, char *argv[]){
  char c[26];
  for (int i = 0; i < 26; i++) {
    c[i] = 'a' + i;
  }
  vector<string> vs;
  string s;
  string ans[] = {"this", "that", "the"};
  vector<string> tmp;
  while(cin >> s)vs.push_back(s);
  vs[vs.size() - 1].pop_back();
  for (int k = 0; k < 26; k++) {
    tmp = vs;
    for (int i = 0; i < vs.size(); i++) {
      for (int j = 0; j < vs[i].length(); j++) {
        tmp[i][j] = c[(vs[i][j] - 'a' + k) % 25];
      }
    }
    for (int i = 0; i < 3; i++) {
      for (int j = 0; j < tmp.size(); j++) {
        if(tmp[j] == ans[i]){k = 50, i = 10, j = 1000;}
      }
    }
  }
  for (int i = 0; i < tmp.size(); i++) {
    std::cout << tmp[i];
    if(i == tmp.size() - 1)std::cout << "." << std::endl;
    else std::cout << " ";
  }
  return 0;
}

C++: #include<iostream>
#include<string>
#include<sstream>
#include<vector>
using namespace std;
#define REP(i, j) for(int i = 0; i < j; i++)
#define FOR(i, j, k) for(int i = j; i < k; i++)
const int N = 30;

bool isOK(vector<string> v){
    REP(i, v.size()) if(v[i] == "the" || v[i] == "this" || v[i] == "that") return true;
    return false;
}

int main(){
    string str;
    while(getline(cin, str)){
        str = str.substr(0, str.length());
        string tmp;
        stringstream ss(str);
        vector<string> v;
        while(ss >>tmp) v.push_back(tmp);
        REP(z, N){
            REP(i, v.size()) REP(j, v[i].length()) v[i][j] = ++v[i][j] <= 'z'? v[i][j] : 'a';
            if(isOK(v)){
                cout <<v[0];
                FOR(i, 1, v.size()) cout <<" " <<v[i];
                cout <<'.' <<endl;
                break;
            }
        }
    }
    return 0;
}

C++: #include<stdio.h>
#include<iostream>
#include<math.h>
#include<string>
using namespace std;
int main(){
	
	char s[1000];
	while(cin.getline(s,1000)){
		for(int i=0;s[i]!='\0';i++){
			if((s[i]-s[i+1]=='t'-'h')&&(((s[i+1]-s[i+2]=='h'-'i')&&(s[i+2]-s[i+3]=='i'-'s'))||(s[i+1]-s[i+2]=='h'-'e')||((s[i+1]-s[i+2]=='h'-'a')&&(s[i+2]-s[i+3]=='a'-'t')))){
				for(int j=0;s[j]!='\0';j++){
					if((s[j]!=' ')&&(s[j]!='.')&&(s[j]!='\n')){
						if((s[j]+'t'-s[i]-'a')%24<0){
							putchar('z'+1+(s[j]+'t'-s[i]-'a')%24);
						}else{
							putchar((s[j]+'t'-s[i]-'a')%24+'a');
						}
					}else{
						putchar(s[j]);
					}
				}cout<<endl;
				break;
			}
		}
	}
	return 0;
}

C++: #include <fstream>
#include <iostream>
#include <cmath>
#include <vector>
#include <queue>
#include <utility>
#include <algorithm>
using namespace std;

char shift(char c, int n) {
  if (c >= 'a' && c <= 'z')
    return (c + n <= 'z') ? c + n : 'a' + (c + n - 'z' - 1);
  else
    return c;
}

bool is_abc(char a) {
  return a >= 'a' && a <= 'z';
}

bool exist(string str, string c) {
  int id = str.find(c, 0);
  while (id != string::npos) {
    if (id > 0 && is_abc(str[id-1])) {
      id++;
      id = str.find(c, id);
    } else if (id + c.length() < str.length() && is_abc(str[id + c.length()])) {
      id++;
      id = str.find(c, id);
    } else {
      return true;
    }
  }
  return false;
}

int main() {
  // ifstream cin("../test.txt");
  vector<string> _the(26);
  vector<string> _this(26);
  vector<string> _that(26);
  _the[0] = "the";
  _this[0] = "this";
  _that[0] = "that";
  for (int i = 1; i < 26; i++) {
    for (int j = 0; j < 3; j++) {
      _the[i] += shift(_the[0][j], i);
    }
    for (int j = 0; j < 4; j++) {
      _this[i] += shift(_this[0][j], i);
      _that[i] += shift(_that[0][j], i);
    }
  }

  string str, nstr;
  // 復号化
  while (getline(cin, str)) {
    if (str.length() == 0) break;
    nstr = "";
    for (int i = 1; i < 26; i++) {
      if ( exist(str, _the[i]) || exist(str, _this[i]) || exist(str, _that[i])) {
        int len = str.length();
        for (int j = 0; j < len; j++) {
          nstr += shift(str.at(j), 26 - i);
        }
        break;
      }
    }

    cout << nstr << endl;
  }
  // 暗号化
  // while (getline(cin, str)) {
  //   for (int i = 1; i < 26; i++) {
  //     nstr = "";
  //     int len = str.length();
  //     for (int j = 0; j < len; j++) {
  //       nstr += shift(str[j], i);
  //     }
  //     cout << nstr << endl;
  //   }
  // }
}