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 REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++) 
#define ALL(n) begin(n),end(n)
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
int main()
{
    string S;
    while( getline( cin, S ) )
    {
        while( S.find( "the" ) == string::npos || S.find( "this" ) == string::npos || S.find( "that" ) == string::npos )
        {
            REP( i, (int)S.size() )
            {
                if( S[ i ] != ' ' && S[ i ] != '.' )
                {
                    if( S[ i ] == 'z' )
                    {
                        S[ i ] = 'a';
                        continue;
                    }
                    S[ i ]++;
                }
            }
        }
        cout << S << endl;
    }
    return 0;
}

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

using namespace std;

bool is_comprehensible(const string& str){
	istringstream iss(str);
	string word;
	while(iss >> word){
		if(word == "the" || word == "this" || word == "that"){
			return true;
		}
	}
	return false;
}

string shift_string(const string& str, char n){
	string result;
	for(auto& v: str){
		if('a' <= v && v <= 'z'){
			result += (v - 'a' + n) % 26 + 'a';
		}
		else{
			result += v;
		}
	}
	return result;
}

int main(){
	string str;
	cin >> noskipws;
	char c;
	while(cin >> c){
		str += c;
	}
	
	for(int i = 0; i < 26; ++i){
		auto shifted = shift_string(str, i);
		if(is_comprehensible(shifted)){
			cout << shifted << flush;
			break;
		}
	}
	return 0;
}

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

using namespace std;

char data[26]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
char trans[100];
char mozi;
int position=0;
int zoom;
int first_check=0,first_position=0;
int now;
char result;

int main(){
	while(scanf("%c",&mozi)){

		if(first_check == 0)

		for(int i=0;i<26 && first_check == 0;i++){
			if(mozi == data[i]){
				first_position = i;
				zoom = first_position - 19;
				first_check = 1;
				break;
			}
		}




		if(mozi == ' ' || mozi == '.' || mozi == '\n'){
			if(mozi == ' ' || mozi == '.'){
				trans[position] = mozi;
				position++;
			}

			if(mozi == '\n'){
				trans[position] = '\n';
				cout << trans << endl;
				first_check = 0;
				position = 0;
				memset(trans,'\0',sizeof(trans));
			}
		}else{
			for(int i=0;i<26;i++){
				if(data[i] == mozi){
					now = i;
					break;
				}
			}

			trans[position] = data[now - zoom];
			position++;

		}
	}
}

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

bool find(const std::string &text, const std::string pattern){
	int text_i=0,pattern_i=0;
	while(text_i<text.size()&&pattern_i<pattern.size()){
		if(text[text_i]==pattern[pattern_i]) {
			text_i++;
			pattern_i++;
		}else{
			pattern_i=0;
			text_i=text_i-pattern_i+1;
		}
	}
	return (pattern_i==pattern.size()?true:false);
}


void decode( std::string &coded_data,int diff){
	for(int i=0;i<coded_data.size();i++){
		if(isalpha(coded_data[i])){
			coded_data[i]-=diff;
			if(!isalpha(coded_data[i])) coded_data[i]+=26;
		}
	}
}

int main(void){
	std::string coded_data;
	while(std::getline(std::cin,coded_data)){
		for(int i=1;i<26;i++){
			decode(coded_data,1);
			if(find(coded_data,"the") || find(coded_data,"this")||find(coded_data,"that"))
				std::cout<<coded_data<<std::endl;
		}
	}

	return 0;
}

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

int main(){
	char s[100];

	int count = 0;

	gets(s);

	int diff = s[0] - 't';

	for (int j = 0; j < strlen(s); j++){
		if (s[j] == '.' || s[j] == ' ')
			continue;
		s[j] -= diff;
	}

	printf("%s",s);

	return 0;
}

C++: #include <iostream>
#include <string.h>
#include <string>
#include <stdio.h>
using namespace std;
int main() {
	char st[80];
	string w[3]={"the","this","that"};
	int wn[3]={3,4,4},k,i,j,s,f,z;
	while(true) {
    k=0; z=0;
	scanf("%[^\0]",st);
	z=strlen(st);
	while(k<z) {
		for (i=0;i<3;i++) {
			s=0; f=0;
			if (z<k+wn[i]) break;
			for (j=0;j<wn[i]-1;j++) if ((w[i][j]-w[i][j+1])==(st[k+j]-st[k+j+1])) s++;
			if (s==wn[i]-1 && (st[k+wn[i]]<'a' || st[k+wn[i]]>'z' ))  { f=1; i=5;}
		}
		if (f==1) break;
		for (k;st[k]>='a' && st[k]<='z';k++);
		k++;
		}
	if (f==0) cout << st; else {
	for (i=0;i<z;i++) if ((st[i]>='a' && st[i]<='z')) cout << (char)(st[i]-(st[k]-'t')) ; else cout << st[i];
	}	
	cout << endl;
	}
    return 0;
	}

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

int main(){
	char s[80],os[80];
	gets(s);
	int len=strlen(s);
	int i,j;
	for(j=0;j<len;j++)os[j]=s[j];
	os[len]='\0';
	for(j=0;j<26;j++){
		for(i=0;i<len;i++){
			if(s[i]>='a'&&s[i]<='z'){
				s[i]-=j;
				if(s[i]<'a')s[i]+=('z'-'a');
			}
		}
		if(strstr(s,"this")!=NULL||strstr(s,"the")!=NULL||strstr(s,"that")!=NULL){
			goto end;
		}
		for(i=0;i<len;i++)s[i]=os[i];
	}
end:
	for(i=0;i<len;i++){
		if(os[i]>='a'&&os[i]<='z'){
			os[i]-=j;
			if(os[i]<'a')os[i]+=('z'-'a');
		}
	}
	printf("%s\n",os);
	return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
int main(){
	string str;int n=0; bool flag=false;
	getline(cin,str);
	for(int k=0;k<26;k++){
		for(int i=0;i<str.size();i++){
				if(str[i]-'a'<0 || str[i]-'z'>0) ;
				else if(++str[i]-'z'>0) str[i]-=26;		
		};
		string ptr; string qtr;
		for(int i=0;i<str.size()-4;i++){
		ptr=str.substr(i,4); qtr=str.substr(i,3);
			if(ptr=="this" || ptr=="that" || qtr=="the") flag=true;
			if(flag==true) break;
		};
		if(flag==true) break;
	};
	cout << str << '\n' ;
}

C++: #include<iostream>
#include<vector>
#include<string>
using namespace std;
int main(){
	int res=0;
	vector<string> buf;
	string str;
	while((cin>>str)!=NULL)
		buf.push_back(str);
	for(int ptr=0;ptr<buf.size();++ptr){
		if(res!=0) break;
		if(buf[ptr].length()>2)
		if(buf[ptr][0]-buf[ptr][1]=='t'-'h'){
			int dif='t'-buf[ptr][0];
			cout<<dif<<endl;
			string tmp;
			for(int i=0;i<buf[ptr].length();++i)
				tmp += (buf[ptr][i]-'a'+dif)%26+'a';
			cout << tmp << endl;
			if(tmp=="the" or tmp=="this" or tmp=="that"){
				res = dif;
				break;
			}
		}
		cout<<1;
	}
	if(res!=0){
		for(int ptr=0;ptr<buf.size();++ptr){
			string tmp;
			for(int i=0;i<buf[ptr].length();++i)
				tmp += ((buf[ptr][i]=='.') ? '.' : (buf[ptr][i]-'a'+res)%26+'a');
			cout<<tmp<<" ";
		}
	}
	if(res==0) cout<<"-1";
	cout<<endl;
	return 0;
}