Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	for scanner.Scan() {
		var result string
		line := scanner.Text()
		key := make(map[string]string)

		var i int32
		for ; i < 52; i++ {
			makeKey(key, i)
			result = decode(key, line)

			if strings.Contains(result, "the") {
				break
			} else if strings.Contains(result, "this") {
				break
			} else if strings.Contains(result, "that") {
				break
			}
		}

		fmt.Println(result)
	}
}

func makeKey(key map[string]string, shift int32) {
	for i := 'a'; i <= 'z'; i++ {
		cipher := (i + shift)
		if cipher > 'z' {
			cipher = cipher%'z' + 'a' - 1
		} else if cipher < 'a' {
			cipher = cipher + ('z' - 'a') + 1
		}
		key[string(i)] = string(cipher)
	}
}

func decode(key map[string]string, cipher string) string {
	var result string
	for _, v := range cipher {
		if key[string(v)] != "" {
			result += key[string(v)]
		} else {
			result += string(v)
		}
	}
	return result
}

C++: #include<stdio.h>

int main()
{
    char a;
    while(scanf("%c",&a)==1)
    {
if (a =='a')
    printf("w");
if (a=='b')
    printf("x");
if (a=='c')
    printf("y");
if (a=='d')
    printf("z");
if (a=='e')
    printf("a");
if (a=='f')
    printf("b");
if (a=='g')
    printf("c");
if (a=='h')
    printf("d");
if (a=='i')
    printf("e");
if (a=='j')
    printf("f");
if (a=='k')
    printf("g");
if (a=='l')
    printf("h");
if (a=='m')
    printf("i");
if (a=='n')
    printf("j");
if (a=='o')
    printf("k");
if (a=='p')
    printf("l");
if (a=='q')
    printf("m");
if (a=='r')
    printf("n");
if (a=='s')
    printf("o");
if (a=='t')
    printf("p");
if (a=='u')
    printf("q");
if (a=='v')
    printf("r");
if (a=='w')
    printf("s");
if (a=='x')
    printf("t");
if (a=='y')
    printf("u");
if (a=='z')
    printf("v");
if (a==' ')
    printf(" ");
if (a=='\n')
    printf("\n");
if (a=='.')
    printf(".");
if (a==',')
    printf(",");
if (a=='!')
    printf("!");
if (a=='/')
    printf("/");
    if (a=='?')
    printf("?");
    if (a==':')
    printf(":");
    if (a==':')
    printf(":");
    if (a=='@')
    printf("@");
    if (a=='1')
    printf("1");
    if (a=='2')
    printf("2");
    if (a=='3')
    printf("3");
    if (a=='4')
    printf("4");
    if (a=='5')
    printf("5");
    if (a=='6')
    printf("6");
    if (a=='7')
    printf("7");
    if (a=='8')
    printf("8");
    if (a=='9')
    printf("9");
    if (a=='0')
    printf("0");
    if (a=='=')
    printf("=");
    if (a=='+')
    printf("+");
    if (a=='-')
    printf("-");
    if (a=='_')
    printf("_");
    }
    return 0;
}

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

int main(){
	string str;
	while(getline(cin, str)){
		while(str.find("this", 0) == string::npos || str.find("that", 0) == string::npos){
			for(int i = 0; i < str.size(); ++i){
				if(str[i] >= 'a' && str[i] <= 'z'){
					if(str[i] != 'z')
						++str[i];
					else
						str[i] = 'a';
				}
			}
		}
		cout << str << endl;
	}
	return 0;
}

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

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;
}