Go: package main

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

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 len(infos) == 0 {
			break
		}
		// 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>
#define rep(i,a,n) for(int i=a;i<n;i++)
using namespace std;
 
int main() {
    string s;
    while(getline(cin,s)) {
        string t;
        rep(j,0,26) {
            t.clear();
            rep(i,0,s.length()) {
                if('a' <= s[i] && s[i] <= 'z') {
                    int val = (s[i] - 'a' + j) % 26;
                    t += ('a' + val);
                }
                else t += s[i];
            }
            if(t.find("this") != string::npos) break;
            else if(t.find("the") != string::npos) break;
            else if(t.find("that") != string::npos) break;
        }
        cout << t << endl;
    }
    return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include<string.h>
#include<ctype.h>

int main()
{
	char str[90];
	
	while( fgets( str, 81, stdin ) != 0 ){
		while( 1 ){
			for( int i = 0; i < strlen( str ); i++ ){
				if( isalpha( str[i] ) ) str[i]++;
				
				if( str[i] > 'z' ){
				 	str[i] = 'a';
				}
			}
			
			if( strstr( str, "the" ) != NULL || strstr( str, "this" ) != NULL || strstr( str, "that" ) != NULL ) break;
		}
		
		std::cout << str;
	}

 	return 0;
}

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


}