Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

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 scanner.Scan() {
		infos := strings.Split(scanner.Text(), " ")
		plain := make([]string, len(infos))
		// 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 <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;
}

C++: #include<iostream>
#include<cstdio>
#include<cmath>
#include<vector>
#include<list>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<string>
#include<utility>
#include<algorithm>
#include<functional>
#include<deque>
#include<string.h>
#include<ctype.h>
#include<time.h>
#include<stdlib.h>
using namespace std;

char c[85];

bool search_th(){
  bool f = false;
  for (int i = 0; i < strlen(c); i++){
    if ((c[i] == 't' && c[i+1] == 'h' && c[i+2] == 'e') ||
        (c[i] == 't' && c[i+1] == 'h' && c[i+2] == 'i' && c[i+3] == 's') ||
        (c[i] == 't' && c[i+1] == 'h' && c[i+2] == 'a' && c[i+3] == 't')){
          f = true;  break;
    }
  }
  return f;
}

int main(){
  while (cin.getline(c, sizeof(c))){
    while (1){
      if (search_th() == true){
      cout << c << endl;
      break;
      }
      for (int j = 0; j < strlen(c); j++){
        if (c[j] >= 'a' && c[j] <= 'y'){
          c[j]++;
        } else if (c[j] == 'z'){
          c[j] = 'a';
        }
      }
    }
    for (int i = strlen(c); i < 85; i++){
      c[i] = '\0';
    }
  }
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
	string s;
	while(getline(cin,s)){
		for(int i=0;i<27;i++){
			string t=s;
			for(int j=0;j<(int)s.size();j++){
				if('a'<=t[j]&&t[j]<='z')	t[j]='a'+(t[j]-'a'+i)%26;
			}
			if(t.find("the",0)!=string::npos){
				cout<<t<<endl;
				break;
			}
			else if(t.find("that",0)!=string::npos){
				cout<<t<<endl;
				break;
			}
			else if(t.find("this",0)!=string::npos){
				cout<<t<<endl;
				break;
			}
		}
	}
	return 0;
}