Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

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

func cipher(text string, direction int, int_shift int) string {
	shift, offset := rune(int_shift), rune(26)
	runes := []rune(text)
	for index, char := range runes {
		switch direction {
		case 1:
			if char >= 'a' && char <= 'z'-shift || char >= 'A' && char <= 'Z'-shift {
				char = char + shift
			} else if char > 'z'-shift && char <= 'z' || char > 'Z'-shift && char <= 'Z' {
				char = char + shift - offset
			}
		case -1:
			if char >= 'a'+shift && char <= 'z' || char >= 'A'+shift && char <= 'Z' {
				char = char - shift
			} else if char >= 'a' && char < 'a'+shift || char >= 'A' && char < 'A'+shift {
				char = char - shift + offset
			}
		}
		runes[index] = char
	}
	return string(runes)
}

func main() {
	for {
		infos := strings.Split(nextString(), " ")
		plain := make([]string, len(infos))
		if reflect.DeepEqual(infos, []string{}) {
			break
		}
		fmt.Println(infos)
		Decryption:
			for i := 0; i < 26; i++ {
				for j := range infos {
					plain[j] = cipher(infos[j], 1, i)
				}
				for j := range plain {
					if plain[j] == "this" || plain[j] == "that" || plain[j] == "the" {
						break Decryption
					}
				}
			}
			fmt.Println(strings.Join(plain, " "))
	}
}

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