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<iostream>
#include<string>
using namespace std;

int main(void){
	string in;
	while(cin>>in){
		for(int i=0;i<in.size();i++){
			if('a'<=in[i]&&in[i]<='z'){
				in[i]-=4;
				if(in[i]-'a'<0)in[i]+=26;
			}
		}
		cout<<in<<" ";
	}
	cout<<endl;

}

C++: #include<iostream>
#include<string.h>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#define li long long int
#define ld long long double
#define PI 3.1415926535897932384626
#define EPS 0.0000000001
#define rep(i,n) for(i=0;i<n;i++)
using namespace std;
typedef pair<int, int> P;

string str;
char word[3][5]={"the","this","that"};
char sent[80][80]={};
int main()
{
  bool ans=false;
  while(getline(cin,str)){
    int i=0,j=0;
    if(str.size()==0)break;
    scanf("%*c");
    int num=0;
    for(i=0;num<str.size();i++){
      for(j=0;;j++){
	sent[i][j]=str[num];
	num++;
	if(sent[i][j]==' '){
	  sent[i][j]='\0';
	  break;
	}
	if(sent[i][j]=='\0')break;
      }
    }
    //cout<<i<<endl;
    int gap,k,l;
    
    rep(gap,26){
      rep(k,i) rep(l,strlen(sent[k])){
	if(sent[k][l]>='a' && sent[k][l]<'z')
	   sent[k][l]++;//??????????????????
	else if(sent[k][l]=='z')
	  sent[k][l]='a';
      	//cout<<sent[k][l];//debug
      }
      // cout<<endl;//debug
      rep(k,i)
	if(strcmp(sent[k],word[0])==0 || strcmp(sent[k],word[1])==0 
	   || strcmp(sent[k],word[2])==0){
	  rep(l,i){
	    for(int a=0;a<strlen(sent[l]);a++)
	      cout<<sent[l][a];
	    if(l<i-1)
	      cout<<" ";
	    else
	      cout<<endl;
	  }
	  ans=true;
	  break;
	}
      if(ans)break;
    }
  }
}

C++: #include <iostream>

using namespace std;

int main(void) {
	char str[81];
	int shift = 0;
	while(cin.getline(str, 81)) {
		for(int i = 0; str[i] != NULL; i++) {
			if((str[i] != NULL) && (str[i+1] != NULL) && (str[i+2] != NULL) &&
				(str[i] != ' ') && (str[i+1] != ' ') && (str[i+2] != ' ')) {
					if(str[i+1] - str[i] == 'h' - 't') {
						if(str[i+2] - str[i+1] == 'e' - 'h') {
							shift = 't' - str[i];
							break;
						}
						if(str[i+3] != NULL && str[i+3] != ' ') {
							if((str[i+2] - str[i+1] == 'i' - 'h') && (str[i+3] - str[i+2] == 's' - 'i')) {
								shift = 't' - str[i];
								break;
							}
							if((str[i+2] - str[i+1] == 'a' - 'h') && (str[i+3] - str[i+2] == 't' - 'a')) {
								shift = 't' - str[i];
								break;
							}
						}
					}
			}
		}

		for(int i = 0; str[i] != NULL; i++) {
			if(str[i] != ' ' && str[i] != '.') {
				str[i] = (str[i] - 'a' + shift) % ('z' - 'a' + 1) + 'a';
			}
		}

		cout << str << endl;
	}
	return 0;
}

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

bool IsValid(const std::string& Text)
{
    return 
        Text.find("the")  != std::string::npos ||
        Text.find("this") != std::string::npos ||
        Text.find("that") != std::string::npos;
}
std::string RotateChar(const std::string& Code, int Key)
{
    std::string Text = Code;
    for(std::size_t i = 0; i < Text.size(); ++i){
        if(Text[i] == ','
        || Text[i] == '.'
        || Text[i] == ' '){
            continue;
        }
        int c = Text[i] + Key;
        if(c < 'a') c += 26;
        if(c > 'z') c -= 26;
        Text[i] = c;
    }
    return Text;
}
std::string Decrypt(const std::string& Code)
{
    for(int i = 0; i < 26; ++i){
        std::string Text = RotateChar(Code, i);
        if(IsValid(Text)){
            return Text;
        }
    }

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

int caesar[26][255], x, enkrip[100];
int thiss[] = {'t', 'h', 'i', 's'}, the[] = {'t', 'h', 'e'}, that[] = {'t', 'h', 'a', 't'};
string s;
int main() {
	for(int i = 0; i <= 25; i++) {
		for(char j = 'a'; j <= 'z'; j++) {
			if(j + i > 'z') x = j + i - 26; else x = j + i;
			caesar[i][x] = j;
		}
	}
	while(getline(cin, s)) {
	for(int k = 0; k <= 25; k++) {
		int l = 0, z = 0, zz = 0;
		for(int i = 0, j = s.size(); i != j; i++) {
			if(s[i] <= 'z' && s[i] >= 'a') {
				enkrip[i] = caesar[k][s[i]];
				if(enkrip[i] == thiss[l]) l++;
				if(enkrip[i] == the[z]) z++;
				if(enkrip[i] == that[zz]) zz++;
			} else {enkrip[i] = s[i]; if(l < 4) l = 0; if(z < 3) z = 0;if(zz < 4) zz = 0; }
		}
		if(l >= 4 || z >= 3 || zz >= 4) {
			for(int i = 0, j = s.size(); i != j; i++) {
				printf("%c", enkrip[i]);
			}
			printf("\n");
			break;
		}
	}}
	return 0;
}

C++: #include<string>
#include<iostream>
#include<algorithm>
using namespace std;
string henkan(string a)
{
	for (unsigned int i = 0; i < a.size(); i++)
	{
		if (a[i] != ' '&&a[i] != '.'&&a[i]!='\n')
		{
			if (a[i] == 'z')a[i] = 'a';
			else 
				a[i] += 1;
		}
	}
	return a;
}
bool check(string a)
{
	string x[3] = { "the", "this", "that" };
	for (int i = 0; i < 3; i++)
	{
		if (a.find(x[i], 0) != string::npos)return false;
	}
	return true;
}
int main()
{
	
	string a, b;
	while (getline(cin,b))
	{
		a.append(b);
		a.append("\n");
	}
	while (check(a))
	{
		a = henkan(a);
	}
	cout << a << endl;
	
}