Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

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

func incrementByte(b byte) byte {
	if b >= 97 && b < 122 {
		return b + 1
	} else if b == 122 {
		return 97
	}
	return b
}

func main() {
	scanner.Split(bufio.ScanLines)

	for {
		line := nextString()
		if len(line) == 0 {
			break
		}
		for i := 0; i <= 26; i++ {
			decoded := []byte{}
			for j := 0; j < len(line); j++ {
				decoded = append(decoded, incrementByte(line[j]))
			}
			line = string(decoded)
			if strings.Contains(line, "the") || strings.Contains(line, "this") || strings.Contains(line, "that") {
				fmt.Println(line)
				break
			}
		}
	}
}

C++: #include <iostream>

using namespace std;

int main(void) {
	char str[81];
	int shift = 0;
	while(cin.getline(str, 81)) {
		shift = 0;
		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)) % ('z' - 'a' + 1) + 'a';
			}
		}

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

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#define INF 1000000000

using namespace std;

// the this that

int main() {
  string str,n1="the",n2="this",n3="that";
  while (getline(cin, str)) {    
    for (int i=0; i<26; i++) {
      for (int j=0; j<3; j++) n1[j] = (n1[j]=='z')? 'a' : n1[j] + 1;
      for (int j=0; j<4; j++) n2[j] = (n2[j]=='z')? 'a' : n2[j] + 1;
      for (int j=0; j<4; j++) n3[j] = (n3[j]=='z')? 'a' : n3[j] + 1;
      if (str.find(n1)!=string::npos||str.find(n2)!=string::npos||str.find(n3)!=string::npos) {
	for (int j=0; j<str.length(); j++) {
	  if (isalpha(str[j])) {
	    str[j]=(str[j]+i)%26+'a';
	  }
	}
	break;
      }
    }
    cout << str << endl;
  }
}

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

std::string Caesar(std::string str, int tranceNum )
{
	for(size_t i=0; i<str.length(); ++i)
	{
		if(str[i]!='.')
		{
			int chNum = 0;
	
			chNum = str[i];

			chNum += tranceNum;

			chNum = (chNum-97)%26+97;
	
			str[i] = chNum;	
		
		}
	}

	return str;
}

int main(void)
{
	std::string str;
	
	std::vector<std::string> sentence;

	while(1)
	{
		std::cout << "もふり\n";
	
		while(std::cin >> str)
		{
			sentence.push_back(str);
				
			if(sentence[sentence.size()-1][sentence[sentence.size()-1].length()-1]=='.')
			{
				break;
			}
		}

		if(std::cin.eof())
		{
			break;
		}

		for(bool flg=1; flg; )
		{
			for(size_t j=0; j<sentence.size(); ++j)
			{
			sentence[j] = Caesar(sentence[j],1);	
			}
	
			for(size_t j=0; (j<sentence.size()) && flg; ++j)
			{
				switch(sentence[j].length())
				{
				case 3:
					flg = (sentence[j]=="the") ? 0 : 1;
					break;
				case 4:
					flg = (sentence[j]=="that" || sentence[j]=="this") ? 0 : 1;
					break;
				case 5:
					flg = (sentence[j]=="that." || sentence[j]=="this.") ? 0 : 1;
					break;
				default:
					break;
				}
			}
		}
		for(size_t j=0; j<sentence.size(); ++j)
		{
			std::cout << sentence[j] << ' ';
		}
		std::cout << '\n';
	
		sentence.clear();
		}
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
  string str;
  while(getline(cin,str)){
    while(str.find("the")==-1&&
	  str.find("this")==-1&&
	  str.find("that")==-1){
      int i;
      for(i=0;i<str.size();i++){
	if('a'<=str[i]&&str[i]<'z') str[i]++;
	else if(str[i]=='z') str[i]='a';
      }
    }
    cout << str << endl;
  }
  return 0;
}

C++: char*c;a[99];main(){for(scanf("%[^\n]",a);!(strstr(a,"this")||strstr(a,"that")||strstr(a,"the"));)for(c=a;*c;c++)*c<97||(*c=(*c+8)%26+97);puts(a);}

C++: #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;
typedef pair<int, int>P;

int main() {
	string s;
	while (getline(cin, s)) {
		while (1) {
			for (char &c : s) {
				if (isalpha(c)) {
					if (c == 'z')c = 'a';
					else c++;
				}
			}
			if ((int)s.find("the") >= 0 || (int)s.find("this") >= 0 || (int)s.find("that") >= 0)break;
		}
		cout << s << endl;
	}
	return 0;
}

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

using namespace std;

int main(){
	char ciph[81];

	while(cin.getline(ciph,81)){
		int len=strlen(ciph);
		int shift=0;
		for(int j=0;j<len-2;j++){
			if(ciph[j+1]-ciph[j+0]=='h'-'t'
			&& ciph[j+2]-ciph[j+1]=='e'-'h'
			&& !islower(ciph[j+3])){
				shift=ciph[j]-'t';
				if(shift<0)	shift+=26;
				break;
			}
		}
		for(int j=0;j<len-3;j++){
			if(ciph[j+1]-ciph[j+0]=='h'-'t'
			&& ciph[j+2]-ciph[j+1]=='i'-'h'
			&& ciph[j+3]-ciph[j+2]=='s'-'i'
			&& !islower(ciph[j+4])){
				shift=ciph[j]-'t';
				if(shift<0)	shift+=26;
				break;
			}
		}
		for(int j=0;j<len-3;j++){
			if(ciph[j+1]-ciph[j+0]=='h'-'t'
			&& ciph[j+2]-ciph[j+1]=='a'-'h'
			&& ciph[j+3]-ciph[j+2]=='t'-'a'
			&& !islower(ciph[j+4])){
				shift=ciph[j]-'t';
				if(shift<0)	shift+=26;
				break;
			}
		}
		for(int i=0;i<len;i++){
			if(islower(ciph[i])){
				ciph[i]-=shift;
				if(ciph[i]<'a')	ciph[i]+=26;
			}
		}
		cout<<ciph<<endl;
	}

	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
signed main(){
        char s[100];
        while( fgets(s, 100, stdin) != NULL ){
                for(int i=0;i<25;i++){
                        for(int j=0;j<100;j++){
                                if(s[j]=='a') s[j] = 'z';
                                else if('a'<s[j]&&s[j]<='z') s[j]-=1;
                        }
                        if(strstr(s,"the")!=NULL ||
                                        strstr(s,"this")!=NULL ||
                                        strstr(s,"that")!=NULL){
                                printf("%s",s);
                                break;
                        }
                }
        }
        return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
string S;
int main() {
	while (getline(cin, S)) {
		for (int h = 0; h < 26; h++) {
			if (S.find("this") != string::npos) {
				goto E;
			}
			if (S.find("that") != string::npos) {
				goto E;
			}
			if (S.find("the") != string::npos) {
				goto E;
			}
			for (int i = 0; i < S.size(); i++) {
				if (S[i] >= 'a') {
					if (S[i] == 'z') {
						S[i] -= 25;
					}
					else {
						S[i]++;
					}
				}
			}
		}
	E:;
		cout << S << endl;
	}
}

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

using namespace std;

bool tJudge(string text);
void tShift(string &text);

int main(void) {
	string text;
	while(1) {
		getline(cin, text);
		
		if( cin.eof() )		break;
		while(1) {
			if( tJudge(text) ) {
				cout << text << endl;
				break;
			} else {
				tShift(text);
			}
		}
	}
	
	return 0;
}

bool tJudge(string text) {
	string word[3] = {"the", "this", "that"};
	for(int i = 0; i < 3; i++) {
		if(text.find(word[i], 0) != string::npos) {
			return true;
		}
	}
	return false;
}

void tShift(string &text) {
	for(unsigned int i = 0; i < text.size(); i++) {
		if ( text[i] >= 'a' && text[i] < 'z') {
			text[i]++;
		} else if (text[i] == 'z') {
			text[i] = 'a';
		}
	}
}