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<cstring>
#include<iostream>
using namespace std;
char s[1005];
char ans[1005];
int main()
{
    while(cin.getline(s,1000))
    {
        int len=(int)strlen(s);
        for(int i=0;i<26;i++)
        {
            for(int j=0;j<len;j++)
            {
                if(s[j]>='a'&&s[j]<='z')
                    ans[j]=(char)((s[j]-'a'-i+26)%26+'a');
                else
                    ans[j]=s[j];
            }
            ans[len]='\0';
            char *str,*str2,*str3;
            str=strstr(ans,"the");
            str2=strstr(ans,"this");
            str3=strstr(ans,"that");
            if(str==0&&str2==0&&str3==0)continue;
            cout<<ans<<endl;
            break;
        }
    }
}

C++: #include <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
#define rer(i,l,n) for(int i=l;i<=n;i++)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define pb(a) push_back(a)
#define mk(a,b) make_pair(a,b)
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

string change(string s,int n){
	string ret(s);
	rep(i,0,ret.size()){
		if(ret[i]>='a' && ret[i]<='z'){
			if(ret[i]+n>'z') ret[i]+=n-26;
			else ret[i]+=n;
		}
	}
	return ret;
}

int main(){
	string s;
	string str[3]={"this","that","the"};
	string stu[2]={" ","."};
	while(getline(cin,s)){
		bool f=0;
		rep(i,0,26){
			string t;
			t=change(s,i);
			rep(j,0,3){
				rep(k,0,2){
					if(t.find(str[j]+stu[k])!=string::npos){
						o(t); f=1; break;
					}
				}
				if(f) break;
			}if(f) break;
		}
	}
}

C++: #include <bits/stdc++.h>

using namespace std;

int main()
{
	string S , T;
	while(getline(cin , S))
	{
		for(size_t i = 0; i < 26; i++)
		{
			for(auto &x : S)if('a' <= x&&x <= 'z')if(++x > 'z')x -= 26;
			stringstream SS;
			SS << S;
			vector<string>VS;
			bool f = false;
			while(SS >> T)
			{
				if(T == "the" || T == "this" || T == "that" || T == "ths." || T == "this." || T == "that.")
				{
					cout << S << endl;
					f = true;
					break;
				}
			}
			if(f)break;
		}
	}
}

C++: #include <iostream>
#include <string>
#include <string.h>
using namespace std;
int main(){
	string alpha = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz";
	string str;
	while( 1 ){
		getline( cin, str );
		if( getline( cin, str ) ) break;
		for( int a = 0; a < 26; a++ ){
			for( int i = 0; i < str.length(); i++ ){
				for( int j = 0; j < alpha.length(); j++ ){
					if( str[i] == alpha[j] ){
						str[i] = alpha[j + 1];
						break;
					}
				}
			}
		/*char word = strtok( str.c_str(), " " );
		if( word == "the" || word == "that" || word == "this" ) break;
		while( word == NULL ){
			word = strtok( NULL, ' ' );
			if( word == "the" || word == "that" || word == "this" ) goto end;
		}*/
			if( str.find("the") != string::npos || str.find("this") != string::npos || str.find("that") != string::npos ){
				break;
			}
		}
		cout << str << endl;
	}
}

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

using namespace std;

int main() {
	string str;
	string in;
	vector<string> s;
	while (cin >> in) s.push_back(in);
	for (int i=0; i<(int)s.size(); i++) {
		str += s[i];
		if (i<(int)s.size()-1) str += " ";
	}
	
	for (int i=1; i<=26; i++) {
		for (int j=0; j<(int)str.size(); j++) {
			if (str[j] == '.') continue;
			str[j] = str[j] + i;
			if (str[j] > 'z') str[j] = 'a' + str[j] - 'z';
		}
		if (str.find("the")!=str.npos || str.find("this")!=str.npos || str.find("that")!=str.npos) break;
	}
	
	cout << str << endl;
	
	return 0;
}

C++: #include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <fstream>
using namespace std;
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string toStr(T x) { ostringstream sout; sout << x; return sout.str();}
typedef vector<int> vi;
typedef vector<vi>  vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n) FOR(i,0,(n)-1)
const double EPS = 1e-12;
const double PI = acos(-1.0);
const int INF = INT_MAX/10;

int main() {
	string s;
	while(getline(cin, s)) {
		REP(i, 26) {
			REP(j, s.length()) {
				if('a' <= s[j] && s[j] <= 'z') {
					s[j]++;
					if('z' < s[j]) {
						s[j] -= 26;
					}
				}
			}

			if(s.find("the") != string::npos) {
				cout << s << endl;
				goto next;
			} else if(s.find("this") != string::npos) {
				cout << s << endl;
				goto next;
			} else if(s.find("that") != string::npos) {
				cout << s << endl;
				goto next;
			}
		}

		next:;
	}

	return 0;
}

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

using namespace std;

void next(string &s) {
    for (int i = 0; i < s.size(); i++) {
        if (isalpha(s[i])) {
            s[i] = (s[i] + 1 - 'a') % 26 + 'a';
        }
    }
}

int main() {
    string s;
    while (getline(cin, s)) {
        while (true) {
            if (s.find("the") != string::npos) break;
            if (s.find("this") != string::npos) break;
            if (s.find("that") != string::npos) break;
            next(s);
        }
        cout << s << endl;
    }
    return 0;
}