Go: package main

import (
	"bufio"
	"os"
	"strings"
	"fmt"
)

var scanner = bufio.NewScanner(os.Stdin)

func cipher(text string, direction int, int_shift int) string {
	shift, offset := rune(int_shift), rune(26)
	runes := []rune(text)
	for index, char := range runes {
		switch direction {
		case 1:
			if char >= 'a' && char <= 'z'-shift || char >= 'A' && char <= 'Z'-shift {
				char = char + shift
			} else if char > 'z'-shift && char <= 'z' || char > 'Z'-shift && char <= 'Z' {
				char = char + shift - offset
			}
		case -1:
			if char >= 'a'+shift && char <= 'z' || char >= 'A'+shift && char <= 'Z' {
				char = char - shift
			} else if char >= 'a' && char < 'a'+shift || char >= 'A' && char < 'A'+shift {
				char = char - shift + offset
			}
		}
		runes[index] = char
	}
	return string(runes)
}

func main() {
	for scanner.Scan() {
		infos := strings.Split(scanner.Text(), " ")
		plain := make([]string, len(infos))
		// fmt.Println(infos)
		Decryption:
			for i := 0; i < 26; i++ {
				for j := range infos {
					plain[j] = cipher(infos[j], 1, i)
				}
				for j := range plain {
					if plain[j] == "this" || plain[j] == "that" || plain[j] == "the" {
						break Decryption
					}
				}
			}
			fmt.Println(strings.Join(plain, " "))
	}
}

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