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>
#include<cstdio>
#include<string>
#include<algorithm>

using namespace std;

int main(){
	string s;
	while(getline(cin,s)){
		while(1){
			for(int j=0;j<s.size();j++){
				if(s[j]>=97&&s[j]<=122){
					s[j]+=1;
					if(s[j]==123)
					s[j]=97;
				}
			}
			if(s.find("the")!=string::npos)
			break;
			if(s.find("this")!=string::npos)
			break;
			if(s.find("that")!=string::npos)
			break;
		}
			printf("%s\n",s.c_str());
	}
}

C++: #include <stdio.h>
int check(int a,int b,int c,int d)
{
    //printf("[%d][%d][%d][%d]\n",a,b,c,d);
    if(a != 14)return 0;
    else if(b == 23 && c == 0)return 1;
    else if(b == 1 && c == 10 && d == 0)return 1;
    else if(b == 19 && c == 19 && d == 0)return 1;
    else return 0;
}

int main()
{
    int longth,mem;
    while(1)
    {
        char str[90] = {0};
        int mem1[90] = {0},mem2[90] = {0};
        if(scanf("%c",&str[0]) == -1)return 0;
        if(str[0] >= 'a' && 'z' >= str[0])mem1[0] = str[0] - 'a' + 1;
        for(int i = 1; i < 80; i++)
        {
            if(scanf("%c",&str[i]) == -1)break;
            longth = i;
            if(str[i] >= 'a' && 'z' >= str[i])mem1[i] = str[i] - 'a' + 1;
        }
        for(int i = 0; i < longth; i++)
        {
            if(mem1[i] == 0);
            else if(mem1[i + 1] != 0)
            {
                if(mem1[i] <= mem1[i + 1])mem2[i] = mem1[i + 1] - mem1[i];
                else mem2[i] = 26 - mem1[i] + mem1[i + 1];
            }
        }
        /*for(int i = 0; i < longth; i++)
        {
            printf("[%d]",mem2[i]);
        }
        printf("\n");*/
        for(int i = 0; i < longth; i++)
        {
            if(mem2[i] == 0);
            else if(i == 0)if(check(mem2[i],mem2[i + 1],mem2[i + 2],mem2[i + 3]))/*printf("%d\n",i);*/if(mem1[i] <= 20)mem = 20 - mem1[i];else mem = 26 - mem1[i] + 20;
            else if(mem2[i - 1] != 0)if(check(mem2[i],mem2[i + 1],mem2[i + 2],mem2[i + 3]))/*printf("%d\n",i);*/if(mem1[i] <= 20)mem = 19 - mem1[i];else mem = 26 - mem1[i] + 20;
        }
        //printf("{%d}\n",mem);
        for(int i = 0; i < longth; i++)
        {
            if(str[i] >= 'a' && 'z' >= str[i])printf("%c",(str[i] - 'a' + mem) % 26 + 'a');
            else printf("%c",str[i]);
        }
        printf("\n");
    }
}

//14 23 0
//14 1 10 0
//14 19 19 0

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") == string::npos && S[c].find("that") == string::npos && S[c].find("the") == string::npos))
			{
				for (int j = 0; j < C; j++) { cout << S[j]; 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 <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;
			}

		}
	}
	return 0;
}

C++: #include<iostream>
#include<vector>
#include<string>
#include<sstream>
int main()
{
	std::vector<std::string>result;
	for (std::string s; std::getline(std::cin, s);)
	{
		int delta = 0;
		std::stringstream ss;
		ss << s;
		while (!ss.eof())
		{
			std::string temp;
			ss >> temp;
			if (temp.length() == 3 && temp[0] != '.' && temp[1] != '.' && temp[2] != '.')
			{
				int d1 = temp[0] - 't';
				int d2 = temp[1] - 'h';
				int d3 = temp[2] - 'e';
				for (auto i : { &d1,&d2,&d3 })
				{
					if (*i < 0)
					{
						*i += 26;
					}
				}
				if (d1 == d2 && d2 == d3)
				{
					delta = temp[0] - 't';
					break;
				}
			}
			else if (temp.length() == 4 && temp[0] != '.' && temp[1] != '.' && temp[2] != '.' && temp[3] != '.')
			{
				int d1 = temp[0] - 't';
				int d2 = temp[1] - 'h';
				int d3 = temp[2] - 'i';
				int d4 = temp[3] - 's';
				for (auto i : { &d1,&d2,&d3,&d4 })
				{
					if (*i < 0)
					{
						*i += 26;
					}
				}
				if (d1 == d2 && d2 == d3 && d3 == d4)
				{
					delta = temp[0] - 't';
					break;
				}
				d1 = temp[0] - 't';
				d2 = temp[1] - 'h';
				d3 = temp[2] - 'a';
				d4 = temp[3] - 't';
				for (auto i : { &d1,&d2,&d3,&d4 })
				{
					if (*i < 0)
					{
						*i += 26;
					}
				}
				if (d1 == d2 && d2 == d3 && d3 == d4)
				{
					delta = temp[0] - 't';
					break;
				}
			}
		}
		result.push_back(std::string(s.length(), 'a'));
		for (int i = 0; i < s.length(); i++)
		{
			result.back()[i] = 'a' <= s[i] && s[i] <= 'z' ? (s[i] - delta - 'a') % 26 + 'a' : s[i];
		}
	}
	for (auto i : result)
	{
		std::cout << i << std::endl;
	}
	return 0;
}

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

char name[] = {
	'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
	'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
	'u', 'v', 'w', 'x', 'y', 'z', '.'
};

int index(char c){
	if(c == '.') return 26;
	return ((int)c - 97);
}

char change(char c, int i){
	if(c == '.') return '.';
	return name[(index(c) + i) % 26];
}

bool search(vector<string> vs, const string& t, int i){
	for(vector<string>::const_iterator iter = vs.begin();
		iter != vs.end(); iter++)
	{
		int size = (*iter).size();
		string s;
		for(string::const_iterator it = (*iter).begin();
			it != (*iter).end(); it++)
			s.push_back(change((*it),i));
		if((*iter)[size - 1] != '.'){
			if(size == t.size() && equal(s.begin(), s.end(), t.begin()))
				return true;
		} else {
			if(size == t.size() && equal(s.begin(), s.end() - 1, t.begin()))
				return true;
		}
	}
	return false;
}

int main(){
	vector<string> vs;
	string s;
	const string t1("the"), t2("this"), t3("that");
	while(cin >> s)
		vs.push_back(s);
	int i = 0;
	for(; i < 26; i++){
		if(search(vs, t1,i) || search(vs, t2, i) || search(vs, t3, i))
			break;
	}
	for(vector<string>::const_iterator iter = vs.begin(); 
		iter != vs.end(); iter++)
	{
		for(string::const_iterator it = (*iter).begin();
			it != (*iter).end(); it++)
			cout << change(*it, i);
		if(iter == vs.end() - 1)
			cout << endl;
		else cout << " ";
	}
	return 0;
}