Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

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 {
		infos := strings.Split(nextString(), " ")
		plain := make([]string, len(infos))
		if len(infos) == 0 {
			break
		}
		// 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 <string>

bool is_valid(const std::string& str) {
	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){
	int i, len;
	string encrypted, tmp, decoded;

	getline(cin, encrypted);
	len = encrypted.size();

	while(encrypted.find("this") == string::npos ||
		  encrypted.find("that") == string::npos ||
		  encrypted.find("the")  == string::npos){
		for(i=0;i<len;i++){
			if(encrypted[i] >= 97 && encrypted[i] <=122){ //isAlphabet(encrypted[i]);
				encrypted[i] += 1;
				if(encrypted[i] == 123) encrypted[i] = 97;//z->a
			}
		}
	}

	cout << encrypted << endl;

	return 0;
}

C++: #include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;

//// < "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\a.txt" > "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\b.txt"


int main() {
	string st;
	vector<string>ths{ " the "," this "," that " };
	while (getline(cin, st)) {
		st.push_back(' ');
		st.insert(st.begin(), ' ');
		for (int i = 0; i < 26; ++i) {
			string nextst(st);
			for (auto&c : nextst) {
				int n = c - 'a';
				if (n < 0 || n >= 26)continue;
				n += i;
				n %= 26;
				c = 'a' + n;
			}
			bool ok = false;
			for (auto th : ths) {
				if (nextst.find(th) != -1)ok = true;
			}
			if (ok) {
				cout << nextst.substr(1,nextst.size()-2) << endl;
				break;
			}
		}
	}
	return 0;
}

C++: #include <iostream>
#include <string.h>
#include <string>
#include <stdio.h>
using namespace std;
int main() {
	char st[1000];
	string w[3]={"the","this","that"};
	int wn[3]={3,4,4},k,i,j,s,f,z;
	while(true) {
    k=0; z=0;
	scanf("%[^\0]",st);
	z=strlen(st);
	f=0;
	for (i=0;i<z;i++) if (!((st[i]>='a' && st[i]<='z') || st[i]=='.' || st[i]==' ' || st[i]=='\n')) f=1;
	if (f==1 || z>80) continue;
	while(k<z) {
		for (i=0;i<3;i++) {
			s=0; f=0;
			if (z<=k+wn[i]) break;
			for (j=0;j<wn[i]-1;j++) if ((w[i][j]-w[i][j+1])==(st[k+j]-st[k+j+1])) s++;
			if (s==wn[i]-1 && (st[k+wn[i]]<'a' || st[k+wn[i]]>'z' ))  { f=1; i=5;}
		}
		if (f==1) break;
		for (k;st[k]>='a' && st[k]<='z';k++);
		k++;
		}
	if (f==0) cout << st; else {
	for (i=0;i<z;i++) if ((st[i]>='a' && st[i]<='z')) cout << (char)(st[i]-(st[k]-'t')) ; else cout << st[i];
	  }
	cout << endl;
	}
	return 0;
	}

C++: #include<cstdio>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
    string str,kaku[3]={"the","this","that"};
    getline(cin,str);
    while(1){
        for(int i=0;i<str.size();i++){
            if('A'<=str[i]&&str[i]<='Y')str[i]++;
            else if(str[i]=='Z')str[i]-=25;
            else if('a'<=str[i]&&str[i]<='y')str[i]++;
            else if(str[i]=='z')str[i]-=25;
        }
        for(int i=0;i<3;i++){
            if(str.find(kaku[i])!=string::npos)goto exit;
        }
    }
exit:
    cout<<str<<endl;
    return 0;
}

C++: #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>

using namespace std;

typedef long long Int;
typedef vector<int> vint;
typedef pair<int,int> pint;
#define mp make_pair

template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }
int in() { int x; scanf("%d", &x); return x; }

int main() {
	string str;
	char chr[100];
	for(;gets(chr);){
		str=(string)(chr);
		int len=str.size();
		int i,c;
		for(c=1;c<=26;c++){
			for(i=0;i<len;i++){
				if('a'<=str[i]&&str[i]<='z'){
					str[i]++;
					if(str[i]>'z')str[i]='a';
				}
			}
			//cout<<str<<endl;
			if(str.find("the")!=string::npos||str.find("this")!=string::npos||str.find("that")!=string::npos){
				cout<<str<<endl;
				break;
			}
		}
	}
	return 0;
}

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

using namespace std;

char returnc(char c){
  if('a'<=c && c<='z'){
    if(c=='z')return 'a';
    return ++c;
  }
  return c;
}
int main(void){
  string s;
  while(getline(cin,s)){

  vector<string> ss;
  string str;
  s+= " ";
  for(int i = 0 ; i < s.size() ; i ++){
    if(s[i] == ' '){
      ss.push_back(str);
      str="";
    }else{
      str+=s[i];
    }
  }
  bool ok=true;
  string out[] = {"this","that","the"};
  while(ok){
    for(int i = 0 ; i < ss.size(); i ++){
      //cout<<ss[i]<<endl;
      for(int j = 0 ; j < ss[i].size() ; j ++){
	ss[i][j] = returnc(ss[i][j]);
      }
      for(int j = 0 ; j < 3 ; j ++){
	if(ss[i] == out[j])ok=false;
      }
    }
  }
  for(int i = 0 ; i < ss.size()-1 ; i ++){
    cout<<ss[i]<<" ";
  }
  cout<<ss[ss.size() - 1]<<endl;
  }
}

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

const char *table = "abcdefghijklmnopqrstuvwxyz";

int search_number(const std::string &s)
{
    const char *key = "this";
    for (unsigned i = 0; i < s.size() - 3; ++i) {
        if ((s[i] > s[i + 1] && s[i] - s[i + 1] == key[0] - key[1])
                || (s[i] < s[i + 1] && s[i + 1] - s[i] == 26 - (key[0] - key[1]))) {
            int n = s[i] - key[0];
            if (table[(s[i + 2] - 'a' - n) % 26] == key[2]
                    && table[(s[i + 3] - 'a' - n) % 26] == key[3])
                return n;
        }
    }
    return 0;
}

int main()
{
    std::string s;
    while (getline(std::cin, s)) {
        int n = search_number(s);
        for (unsigned i = 0; i < s.size(); ++i) {
            if (s[i] != ' ' && s[i] != ',' && s[i] != '.') {
                s[i] = table[(s[i] - 'a' - n) % 26];
            }
        }
        std::cout << s << std::endl;
    }
}