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 <stdio.h>
#include <stdlib.h>
#include <string.h>
#pragma warning(disable:4996)

bool Check(char* Str);

int main()
{
	int  nCnt = 0;
	char PhraseIn[80];
	char PhraseOut[80] = "\0";
	int  nSlide = 1;

	gets(PhraseIn);

	while (1)
	{
		for (nCnt = 0; PhraseIn[nCnt] != '\0'; nCnt++)
		{
			if (PhraseIn[nCnt] == ' ' || PhraseIn[nCnt] == '.' || PhraseIn[nCnt] == '\n')
			{
				PhraseOut[nCnt] = PhraseIn[nCnt];
				continue;
			}

			PhraseOut[nCnt] = PhraseIn[nCnt] - nSlide;

			if (PhraseOut[nCnt] > 122)
				PhraseOut[nCnt] = 97 + (nSlide-1);

			if (PhraseOut[nCnt] < 97)
				PhraseOut[nCnt] = 122 - (nSlide - 1);
		}

		if (Check(PhraseOut))
			break;
		else
		{
			nSlide++;
			if (nSlide >= 26)
				break;
		}
	}

	if (nSlide < 26)
		printf("%s", PhraseOut);

	return 0;
}

bool Check(char* Str)
{
	int nCnt = 0;
	int nCnt2 = 0;

	while (Str[nCnt] != '\0')
	{
		char Work[80] = "\0";
		nCnt2 = 0;
		while (1)
		{
			if (Str[nCnt] == ' ' || Str[nCnt] == '.' || Str[nCnt] == '\n' || Str[nCnt] == '\0')
			{
				nCnt++;
				break;
			}

			Work[nCnt2] = Str[nCnt];
			nCnt++;
			nCnt2++;
		}

		if (strcmp(Work, "this") == 0 || strcmp(Work, "the") == 0 || strcmp(Work, "that") == 0)
			return true;
	}

	return false;
}

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

bool NotMatch( const std::string& str )
{
	return str.find("the") == std::string::npos && str.find("this") == std::string::npos && str.find("that") == std::string::npos;
}

int main()
{
	std::string str;
	while( getline(std::cin,str) )
	{
		while( NotMatch(str) )
		{
			for( unsigned i=0; i<str.length(); ++i )
			{
				if( str[i]=='.' || str[i]==' ' || str[i]=='\n' )
				{
					continue;
				}

				if( str[i] == 'z' )
				{
					str[i] = 'a';
				}
				else
				{
					--str[i];
				}
			}
		}

		std::cout << str << '\n';
	}
}

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

char cShiftchar(char ch)
{
    if(isalpha(ch))
    {
        ch++;
        if(ch > 'z') ch = ch - 'z' + 'a' -1;
    }

    return ch;
}

string sDecode(string str)
{
    string ans;
    while( -1 == str.find("the")
            && -1 == str.find("this")
            && -1 == str.find("that")
         )
    {
        transform(str.begin(), str.end(), str.begin(), cShiftchar);

    }
    return str;
}

int main()
{
    string str;
    while(getline(cin, str))
    {
        cout << sDecode(str) << endl;
    }
    return EXIT_SUCCESS;
}

C++: //#define _USE_MATH_DEFINES
//#include <cmath>
#include <iostream>
//#include <stdio.h>
//#include <stdlib.h>
//#include <iomanip>
#include <vector>
#include <string>
//#include <algorithm>
//#include <functional>
//#include <time.h>
#include <sstream>

using namespace std;


int main(){

	string s, buf;
	stringstream ss;
	vector <string> as;
	int dif = 0;


	while (getline(cin, s)){
		//for (int i = 0; i < s.size(); i++){
		//	if (s[i] == '.')s[i] = ' ';
		//}
		ss << s;

		while (ss >> buf){
			//the this that???????´¢
			if (buf.size() == 3){
				if ((buf[0] - buf[1]) == 12 && (buf[0] - buf[2]) == 15){
					dif = buf[0] - 't';
					break;
				}
			}
			else if (buf.size() == 4){
				if ((buf[0] - buf[1]) == 12 && (buf[0] - buf[2]) == 11 && (buf[0] - buf[3]) == 1){
					dif = buf[0] - 't';
					break;
				}
				if ((buf[0] - buf[1]) == 12 && (buf[0] - buf[2]) == 19 && (buf[0] - buf[3]) == 0){
					dif = buf[0] - 't';
					break;
				}
			}
		}

		for (int i = 0; i < s.size(); i++){
			if (s[i] >= 'a' && s[i] <= 'z') s[i] -= dif;
		}

		cout << s << endl;
	}




	return 0;
}

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

int main(){
	char s[100];

	int count = 0;

	gets(s);

	int diff;
	for (int j = 0; j < strlen(s); j++){
		diff = s[j] - 't';
		//printf("diff:%d\n", diff);
		if ((s[j+1] - diff)== 'h'){
			//printf("%c\n", s[j+1] - diff);
			if ((s[j+2] - diff) == 'e'){
				//printf("%c\n", s[j + 2] - diff);
				if (s[j+3] == ' '){
					break;
				}
			}
			else if ((s[j + 2] - diff) == 'a'){
				//printf("%c\n", s[j + 2] - diff);
				if ((s[j + 3] - diff) == 't'){
					//printf("%c\n", s[j + 3] - diff);
					if (s[j + 4] == ' '){
						break;
					}
				}
			}
			else if ((s[j + 2] - diff) == 'i'){
				//printf("%c\n", s[j + 2] - diff);
				if ((s[j + 3] - diff) == 's'){
					//printf("%c\n", s[j + 3] - diff);
					if (s[j + 4] == ' '){
						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\n",s);

	return 0;
}

C++: #include<iostream>
#include<string>
#include<cstring>
#include<vector>
using namespace std;
int word_search(vector<string> s,  string key){
	for(int i = 0; i < s.size(); i++){
		if(s[i].length() <= 2 || s[i].length() >= 6) continue;
		for(int j = 0; j < s[i].length() - 1; j++)
			if(s[i][j] == '.') continue;
		if(s[i][s[i].length() - 1] == '.') s[i].erase(s[i].end() - 1);
		for(int j = 0; j < 26; j++){
			string turned_word;
			for(int k = 0; k < s[i].length(); k++){
				turned_word.push_back((s[i][k] + j - 'a') % 26 + 'a');
			}
			if(turned_word == key) return j;
		}
	}
	return -1;
}
int main(){
	for(;;){
		char line[100];
		if(fgets(line, sizeof(line), stdin) == NULL) break;
		vector<string> s;
		char *token = strtok(line, " ");
		s.push_back(token);
		for(;;){
			token = strtok(NULL, " ");
			if(token == NULL) break;
			s.push_back(token);
		}
		int num;
		if(word_search(s, "the") != -1) num = word_search(s, "the");
		if(word_search(s, "this") != -1) num = word_search(s, "this");
		if(word_search(s, "that") != -1) num = word_search(s, "that");
		for(int i = 0; i < s.size(); i++){
			for(int j = 0; j < s[i].length(); j++){
				if(s[i][j] == '.') cout << '.';
				else if(s[i][j] == '\n') continue;
				else cout << (char)((s[i][j] + num - 'a') % 26 + 'a');
			}
			cout << ' ';
		}
		cout << endl;
	}
	return 0;
}

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

int main(void)
{
	char str[81];
	while(gets(str) != NULL)
	{
		int i,j;
		int len = strlen(str);
		for(i = 0;i < 26;i++)
		{
			for(j = 0;j < len;j++)
			{
				if(str[j] >= 'a' && str[j] <= 'z')
				{
					str[j] = (str[j] - 'a' + 1) % 26 + 'a';
				}
			}
			for(j = 0;j < len-2;j++)
			{
				if(str[j] == 't' && str[j+1] == 'h' && str[j+2] == 'e')
				{
					puts(str);
					break;
				}
			}
			if(j != len-2)
				break;
			for(j = 0;j < len-3;j++)
			{
				if(str[j] == 't' && str[j+1] == 'h' && str[j+2] == 'i' && str[j+3] == 's')
				{
					puts(str);
					break;
				}
			}
			if(j != len-3)
				break;
			for(j = 0;j < len-3;j++)
			{
				if(str[j] == 't' && str[j+1] == 'h' && str[j+2] == 'a' && str[j+3] == 't')
				{
					puts(str);
					break;
				}
			}
			if(j != len-3)
				break;
		}
	}
}