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 <cassert>
#include <iostream>
#include <string>

bool IsValid(const std::string& Text)
{
    return 
        Text.find("the")  != std::string::npos ||
        Text.find("this") != std::string::npos ||
        Text.find("that") != std::string::npos;
}
std::string RotateChar(const std::string& Code, int Key)
{
    std::string Text = Code;
    for(std::size_t i = 0; i < Text.size(); ++i){
        if(Text[i] == ','
        || Text[i] == '.'
        || Text[i] == ' '){
            continue;
        }
        int c = Text[i] + Key;
        if(c < 'a') c += 26;
        if(c > 'z') c -= 26;
        Text[i] = c;
    }
    return Text;
}
std::string Decrypt(const std::string& Code)
{
    for(int i = 0; i < 26; ++i){
        std::string Text = RotateChar(Code, i);
        if(IsValid(Text)){
            return Text;
        }
    }
    assert(false);
    return "";
}
int main()
{
    while(true){
        std::string Code;
        std::getline(std::cin, Code);
        if(std::cin.eof()) break;
        std::cout << Decrypt(Code) << std::endl;
    }
    return 0;
}

C++: #include <iostream>
#include <string>
#include <algorithm>

using namespace std;

void shiftchar(char& ch)
{
	if (isalpha(ch)) {
		if (ch == 'z') {
			ch = 'a';
		} else {
			ch = ch + 1;
		}
	}
}

int main()
{
	string input;
	while (getline(cin, input)) {

		string decoded = input;
		for (int i = 0; i < 26; ++i) {
			for_each(decoded.begin(), decoded.end(), shiftchar);
			if (decoded.find("the") != string::npos ||
				decoded.find("this") != string::npos ||
				decoded.find("that") != string::npos) {
				break;
			}
		}

		cout << decoded << endl;
	}

	return 0;
}

C++: #include "bits/stdc++.h"

#define REP(i,num) for(int i=0;i<(num);++i)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto& x:c){cout<<x<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

vector<string> split_naive(const string &s, char delim) {
	vector<string> elems;
	string item;
	for (char ch: s) {
		if (ch == delim) {
			if (!item.empty())
				elems.push_back(item);
			item.clear();
		}
		else {
			item += ch;
		}
	}
	if (!item.empty())
		elems.push_back(item);
	return elems;
}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	char line[100];
	while(cin.getline(line,sizeof(line))){
		string S(line);
		auto T=split_naive(S,' ');
		int offset = 0;
		for(auto& x:T){
			int N=x.size();
			if(N==3){
				int a = x[0]-'a';
				int b = x[1]-'a';
				int c = x[2]-'a';
				if(c>=0 && c<=25 && ((a-b+26)%26)==12 && ((a-c+26)%26)==15){
					offset = a-('t'-'a');
					break;
				}
			}
			else if(N==4){
				int a = x[0]-'a';
				int b = x[1]-'a';
				int c = x[2]-'a';
				int d = x[3]-'a';
				if(d>=0 && d<=25 && ((a-b+26)%26)==12 && ((a-c+26)%26)==19 && ((a-d+26)%26)==0){
					offset = a-('t'-'a');
					break;
				}
				else if(d>=0 && d<=25 && ((a-b+26)%26)==12 && ((a-c+26)%26)==11 && ((a-d+26)%26)==1){
					offset = a-('t'-'a');
					break;
				}
			}
			else if(N==5){
				int a = x[0]-'a';
				int b = x[1]-'a';
				int c = x[2]-'a';
				int d = x[3]-'a';
				if(d>=0 && d<=25 && ((a-b+26)%26)==12 && ((a-c+26)%26)==19 && ((a-d+26)%26)==0){
					offset = a-('t'-'a');
					break;
				}
				else if(d>=0 && d<=25 && ((a-b+26)%26)==12 && ((a-c+26)%26)==11 && ((a-d+26)%26)==1){
					offset = a-('t'-'a');
					break;
				}
			}
		}
		for(int j=0;j<100;j++){
			if(line[j]>='a' && line[j]<='z'){
				int c=line[j]-'a';
				c=(c+26-offset)%26;
				line[j] = c+'a';
			}
		}
		out(line);
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main()
{
    int n=0,m=0,maxe=0,co=0;;
    char str[82][82],a;
    while(cin>>a){
        if(a==' '){
           str[n][m]='\0';
           n++;
           m=0;
        }
        else m++;
    }
    for(int i=1;;i++){
        for(int j=0;j<maxe;j++){
            if(str[j][0]-i=='t'){
                if(str[j][1]-i=='h'&&str[j][2]-i=='i'&&str[j][3]-i=='s'||str[j][1]-i=='h'&&str[j][2]=='e'||str[j][1]-i=='h'&&str[j][2]-i=='a'&&str[j][3]=='t'){
                    co=i;
                    break;
                }
            }
        }
        if(co!=0)break;
    }
    for(int i=0;i<maxe;i++){
        for(int j=0;str[i][j]!='\0';j++){
                if(str[i][j]!='.')printf("%c",str[i][j]-co);
                else cout<<".";
        }
        if(i!=maxe-1)cout<<" ";
        else cout<<endl;
    }


}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <regex>
#include <cctype>
#include <string>
#include <utility>
using namespace std;

vector<string> v;
/*
vector<string> split(string&& s, regex&& pattern) {
    sregex_token_iterator first(s.begin(), s.end(), pattern, -1);
    sregex_token_iterator last;
    return(vector<string>(first, last));
}
*/
bool cheser() {
    for(int r = 1; r <= 26; r++) {
        bool found = false;
        for(int c = 0; c < v.size(); c++) {
            for(int k = 0; k < v[c].length(); k++) {
                if(!isalpha(v[c][k])) continue;
                int now = v[c][k] - 'a';
                now = (now+1)%26;
                v[c][k] = 'a' + now;
            }
            if(v[c] == "the" || v[c] == "this" || v[c] == "that") found = true;
        }
        if(found) return(true);
    }
    return(false);
}

int main(void) {
    string input;
    while(getline(cin, input)) {
       // v = split(move(input), regex(" "));
        cheser();
        for(int r = 0; r < v.size(); r++) {
            cout << v[r];
            if(r == v.size() - 1) cout << endl;
            else                  cout << " ";
        }
    }
    
    return(0);
}

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

const char *table = "abcdefghijklmnopqrstuvwxyz";

int search_number(const std::string &s)
{
    const char *key = "this";
    for (unsigned i = 0; i < s.size() - 3; ++i) {
        if (s[i] > s[i + 1] && s[i] - s[i + 1] == key[0] - key[1]
                || s[i] < s[i + 1] && s[i + 1] - s[i] == 26 - (key[0] - key[1])) {
            int n = s[i] - key[0];
            if (table[(s[i + 2] - 'a' - n) % 26] == key[2]
                    && table[(s[i + 3] - 'a' - n) % 26] == key[3])
                return n;
        }
    }
    return 0;
}

int main()
{
    std::string s;
    while (getline(std::cin, s)) {
        int n = search_number(s);
        for (unsigned i = 0; i < s.size(); ++i) {
            if (s[i] != ' ' && s[i] != ',' && s[i] != '.') {
                s[i] = table[(s[i] - 'a' - n) % 26];
            }
        }
        std::cout << s << std::endl;
    }
}