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 <bits/stdc++.h>
 
using namespace std;
 
#define FOR(i, j, k) for(int i = j; i < k; ++i)
#define rep(i, j) FOR(i, 0, j)
#define repr(i, j) for(int i = j; i >= 0; --i)
#define INF (1 << 30)
#define MOD 1e9 + 7
 
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
 
int main() {
    string s;
    while(getline(cin, s)){
    	rep(i, 26) {
	    	rep(j, s.size()) {
	            if('a' <= s[j] && s[j] <= 'z') s[j] = s[j] + 'a';
	            else s[j] = 'a';
	        }
	        if(s.find("the") != string::npos || s.find("this") != string::npos || s.find("that") != string::npos){
                cout << s << endl;
            }
	    }
    }
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
signed main(void){
	string s;
	while(getline(cin,s)){
		while(s.find("this")==s.npos&&s.find("that")==s.npos&&s.find("the")==s.npos)
			for(int i=0;i<(int)s.length();i++){
				if(s[i]>'z'||s[i]<'a')continue;
				if(s[i]!='z')s[i]++;
				else s[i]='a';
			}
		cout<<s<<endl;
	}
}

C++: #include<cstdio>
#include<cstring>

using namespace std;
int main(void)
{
	char a[1000] = {0};
	int i,j;
	while(scanf("%[^\n]",a) != EOF)
	{
		int as = strlen(a);
		for(i = 0;i < 26;i++)
		{
			if(strstr(a,"this") || strstr(a,"that") || strstr(a,"the")) break;
			for(j = 0;j < as;j++)
			{
				if(a[j] != 46 || a[j] != 32)
				{
					if(a[j] >= 'z')
					{
						a[j] = 'a';
					}
					else
					{
						a[j]++;
					}
				}
			}
		}
		printf("%s\n",a);
	}
	return 0;
}

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

enum result{ NOT_FOUND = -1 };
const int ALPHABET_SIZE = 26;
std::vector<std::string> keyWords = { "the", "that", "this" };

char caesar(const char&, const int);
std::string decode(std::string, int);
bool isKeyWord(std::string);
int askKey(std::vector<std::string>);
std::string dataShaping(std::string);

int  main(){

	std::string str;
	while (std::getline(std::cin, str)){
		std::vector<std::string> cryptography;
		int key;
		std::stringstream ss{ str };
		std::string word;

		while (std::getline(ss, word, ' '))
		{
			cryptography.push_back(word);
		}

		key = askKey(cryptography);
		if (key == NOT_FOUND){
			std::cout << "NOT_FOUND\n";
			return -1;
		}

		for (size_t i = 0; i < cryptography.size(); i++)
		{

			std::cout << decode(cryptography[i], key);
			if (i != cryptography.size() - 1){
				std::cout << ' ';
			}
		}

		std::cout << std::endl;
	}
	return 0;
}


char caesar(const char& chara, const int KEY){
	if (chara >= 'a' && chara <= 'z'){
		int charaIndex = chara - 'a';
		charaIndex = (charaIndex + KEY) % ALPHABET_SIZE;
		return 'a' + charaIndex;
	}
	return chara;
}

std::string decode(std::string str, int key){
	std::string decodedTexts;
	for (auto& chara : str)
	{
		decodedTexts += caesar(chara, key);
	}
	return decodedTexts;
}

bool isKeyWord(std::string str){
	for (auto& keyWord : keyWords)
	{
		if (dataShaping(str) == keyWord){
			return true;
		}
	}
	return false;
}

int askKey(std::vector<std::string> cryptography){
	for (auto& str : cryptography)
	{
		for (size_t i = 0; i <= ALPHABET_SIZE; i++)
		{
			if (isKeyWord(decode(str, i)))
			{
				return i;
			}
		}
	}
	return NOT_FOUND;
}

std::string dataShaping(std::string word){
	unsigned int wordSize = word.size();
	if (word[wordSize - 1] < 'a' || word[wordSize - 1] > 'z'){
		return word.substr(0, wordSize - 1);
	}
	return word;
}

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

int main(int argc, const char * argv[])
{
    string word;
    while (getline(cin, word)) {
        int cnt = 0;
        for (char tmp2 = word[0]; tmp2 <= 'z'; tmp2++) {
            if (tmp2 == 't') {
                break;
            }
            cnt++;
        }
        cnt = 0;
        for (char tmp2 = word[0]; tmp2 >= 'a'; tmp2--) {
            if (tmp2 == 't') {
                break;
            }
            cnt--;
        }
        if (word[1] + cnt == 'h') {
            if (word[2] + cnt == 'e') {
                for (int i = 0; i < word.size(); i++) {
                    if (word[i] == '.') {
                
                    }
                    else if (word[i] != ' ') {
                        word[i] += cnt;
                    }
                }
            }
            if (word[2] + cnt == 'i' && word[3] + cnt == 's') {
                for (int i = 0; i < word.size(); i++) {
                    if (word[i] == '.') {
                        
                    }
                    else if (word[i] != ' ') {
                        word[i] += cnt;
                    }
                }
            }
            if (word[2] + cnt == 'a' && word[3] + cnt == 't') {
                for (int i = 0; i < word.size(); i++) {
                    if (word[i] == '.') {
                        
                    }
                    else if (word[i] != ' ') {
                        word[i] += cnt;
                    }
                }
            }
        }
        cout << word << endl;
    }

    
    return 0;
}

C++: #include<iostream>
#include<string>
int main(){
	std::string str;
	while(std::getline(std::cin,str)){
	for(int i=0;i<str.size();i++){
		if(str[i]!=' ')str[i]+=1;
	}
	std::cout<<str<<std::endl;
	return 0;
}

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

C++: #include <cstdio>
#include <cstring>
using namespace std;

char next(char c)
{
    if ('a' <= c && c <= 'y') {
        return c+1;
    } else if (c == 'z') {
        return 'a';
    }
    return c;
}

int main()
{
    char str[81];
    //while(scanf("%[^\n]", str) != EOF) {
    scanf("%[^\n]",str);
    for(int j=0;j<26;++j) {
        if (strstr(str, "the") || strstr(str, "this") || strstr(str, "that")) {
            break;
        }
        for(int k=0,len=strlen(str);k<len;++k) {
            str[k] = next(str[k]);
        }
    }
    puts(str);
    //}
    return 0;
}