Go: package main

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

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 reflect.DeepEqual(infos, []string{}) {
			break
		}
		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 <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;
}

C++: #include<iostream>
#include<string.h>
#include<stdio.h>

int main(){
	char s[100];

	int count = 0;

	gets(s);

	int diff;
	int flag = false;
	//一番最初に｛the,that,this｝がある場合
	diff = s[0] - 't';
	if ((s[1] - diff) == 'h'){
		//printf("%c\n", s[j+1] - diff);
		if ((s[2] - diff) == 'e'){
			//printf("%c\n", s[j + 2] - diff);
			if (s[3] == ' '){
				flag = true;
			}
		}
		else if ((s[2] - diff) == 'a'){
			//printf("%c\n", s[j + 2] - diff);
			if ((s[3] - diff) == 't'){
				//printf("%c\n", s[j + 3] - diff);
				if (s[4] == ' '){
					flag = true;
				}
			}
		}
		else if ((s[2] - diff) == 'i'){
			//printf("%c\n", s[j + 2] - diff);
			if ((s[3] - diff) == 's'){
				//printf("%c\n", s[j + 3] - diff);
				if (s[4] == ' '){
					flag = true;
				}
			}
		}
	}
	
	if (!flag){
		//一番以降に｛the,that,this｝がある場合
		for (int j = 1; j < strlen(s); j++){
			if ((s[j]) == ' '){
				diff = s[j + 1] - 't';
				if ((s[j + 1] - diff) == 't'){
					//printf("diff:%d\n", diff);
					if ((s[j + 2] - diff) == 'h'){
						//printf("%c\n", s[j+1] - diff);
						if ((s[j + 3] - diff) == 'e'){
							//printf("%c\n", s[j + 2] - diff);
							if (s[j + 4] == ' '){
								break;
							}
						}
						else if ((s[j + 3] - diff) == 'a'){
							//printf("%c\n", s[j + 2] - diff);
							if ((s[j + 4] - diff) == 't'){
								//printf("%c\n", s[j + 3] - diff);
								if (s[j + 5] == ' '){
									break;
								}
							}
						}
						else if ((s[j + 3] - diff) == 'i'){
							//printf("%c\n", s[j + 2] - diff);
							if ((s[j + 4] - diff) == 's'){
								//printf("%c\n", s[j + 3] - diff);
								if (s[j + 5] == ' '){
									break;
								}
							}
						}

					}
				}
			}
		}
	}
	//printf("diff:%d\n",diff);
	for (int i = 0;i < strlen(s);i++){
		if (s[i] == ' ' || s[i] == '.')continue;
		s[i] -= diff;
	}

	printf("%s",s);

	return 0;
}