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 <string>
using namespace std;
int main()
{
    string s;
	while(getline(cin,s)){
		int n=s.size();
		for(int k=0;k<26;k++){
			for(int i=0;i<n;i++)if('a'<=s[i]&&s[i]<='z')s[i]='z'<(s[i]+1)?'a':(s[i]+1);
			if(s.find("the")!=string::npos||s.find("this")!=string::npos||s.find("that")!=string::npos)break;
		}
		cout<<s<<endl;
	}
    return 0;
}

C++: #include <iostream>
#include <algorithm>
#include<string>
#include<vector>
int main() {
	std::string s,a;

	while (std::getline(std::cin, s)) {
		int p = s[0] - 't';
		for (int i = 0; i < s.size(); ++i) {
			if (s[i] != ' ' &&s[i] != '.') {
				if (s[i] - p < 'a') {
					a += 'z' - ('a' - (s[i] - p) - 1);
				}
				else a += s[i] - p;
			}
			else a += s[i];
		}
		std::cout << a << std::endl;
	}	
	return 0;
}

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

int main(){
	string angou;
	
	while (getline(cin, angou)){
		int a = angou.size();

		for (int i = 0; i < 26; i++)
		{
			for (int q = 0; q < a; q++){
				if (angou[q] == ' ' || angou[q] == '.') continue;

				if (angou[q] == 'z') angou[q] = 'a';
				else angou[q]++;
			}

			bool theExists = angou.find("the") != string::npos;
			bool thisExists = angou.find("this") != string::npos;
			bool thatExists = angou.find("that") != string::npos;
			if (theExists || thisExists || thatExists)
			{
				cout << angou << endl;
				continue;
			}
		}
	}

	return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <list>
#include <map>
#include <algorithm>
#include <stack>
#include <string>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>

using namespace std;


int main(){
	string tmp;
	string key[] = {"the","this","that"};
	int alfabet;
	bool clearFlag;
	while(getline(cin,tmp)){
		clearFlag = false;
		alfabet = 26;
		while(alfabet--){

			for(string::iterator it = tmp.begin(); it != tmp.end(); it++){
				if(*it == '\n'){
					it = tmp.erase(it);
				}
				if(*it >= 'a' && *it <= 'z'){
					(*it)++;
					if(*it >= 'z'){
						*it = 'a';
					}
				}
			}
			for(int j = 0; j < 3; j++){
				if(tmp.find(key[j]) != string::npos){
					cout << tmp << endl;
					clearFlag = true;
					break;
				}
			}

			if(clearFlag == true){
				break;
			}

		}

		cout << flush;

	}
	return 0;
}

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

using namespace std;

void f(string &s)
{
    for (char &c : s) {
        if ('a' <= c && c <= 'z') c = (c - 'a' + 25) % 26 + 'a';
    }
}

int main()
{
    string s;

    while (getline(cin, s)) {
        if (s == "") break;
        while (s.find("the") != string::npos && s.find("this") != string::npos && s.find("that") != string::npos) f(s);
        cout << s << endl;
    }
}

C++: #include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
#include <string>
#include <functional>
#include <array>
#include <stack>
#include <queue>
#include <chrono>
#include <numeric>
#include <memory.h>
#include <map>
#include <math.h>
#include <utility>
#include <set>

#pragma warning(disable:4996)
using namespace std;
#define REP(i,n) for(int i = 0 ; i < n ; ++i)
typedef long long Int;
const double PI = 3.141592653589793238;
const Int INF = 999999999999;
typedef pair<int, int> P;


int main()
{
	string a;

	auto s = string::npos;
	while (getline(cin, a)){
		REP(i, 26){
			for (auto& x : a){
				if (x<'a' || x>'z'){
					continue;
				}
				++x;
				if (x > 'z')x = 'a';
			}
			if (a.find("this") != s || a.find("the") != s || a.find("that") != s)
				cout << a << endl;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int eq(string s,int x){
  for(int k=0;k<80;k++){
    if(s[k]=='t' && s[k+1]=='h'&&s[k+2]=='a' && s[k+3]=='t'){
      return x;
    } else 
      if(s[k]=='t' && s[k+1]=='h'&&s[k+2]=='i' && s[k+3]=='s'){
	return x;
      } else
	if(s[k]=='t' && s[k+1]=='h'&&s[k+2]=='e'){
	  return x;
	}
    
  }
  return 30;
}

int nstr(string st,int n){
  for(int k =0;k <80;k++){
    if(st[k] != ' ' && st[k] != '.'){
      if(st[k]+n > 122){
      st[k] = st[k]+n - 26;
      } else {st[k] = st[k] + n;}
    }
  }
  return eq(st,n);
  

}

int main(){
  int i = 0,count=0;
  string str;
  string tmp;
  for(;i<80;){
    cin >> tmp;
    for(int k=0;k<tmp.size();){
      str[i] = tmp[k];
      k++; i++;
    }
    
    if(tmp[tmp.size()-1] == '.'){
      break;
    }
    str[i] = ' '; i++;
   
  }
  
  for(int p=0;p<=25;p++){
    count = nstr(str,p);
    if(count != 30)
      break;
    count = nstr(str,-p);
  }

  for(int p=0;p<=25;p++){
    count = nstr(str,-p);
    if(count != 30)
      break;
    count = nstr(str,+p);
  }
  
  if(count != 30){
    for(int k = 0;k < i;k++)
    cout << str[k];
    cout << endl;
  }
  
}

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

using namespace std;

int main()
{
	string S[80]; int C = 0;

	while (getline(cin, S[C]))
	{
		C++;
	}

	for (int i = 0; i < 26; i++)
	{
		for (int c = 0; c < C; c++)
		{
			if (!(S[c].find("this") == S[c].npos && S[c].find("that") == S[c].npos && S[c].find("the") == S[c].npos))
			{
				for (int j = 0; j < C; j++) { cout << S[c]; goto Exit; }
			}

			for (string::size_type j = 0; j < S[c].size(); j++)
			{
				if (isalpha(static_cast<int>(S[c][j])))
				{
					if (S[c][j] == 'z')
					{
						S[c][j] = 'a';
					}
					else
					{
						S[c][j]++;
					}
				}
			}
		}
	}

Exit:;

	return 0;
}