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 <string>
#include <vector>
#include <iterator>
#include <algorithm>
using namespace std;

char name[] = {
	'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', '.'
};

int index(char c){
	if(c == '.') return 26;
	return ((int)c - 97);
}

char change(char c, int i){
	if(c == '.') return '.';
	if(c == ' ') return ' ';
	return name[(index(c) + i) % 26];
}

char rchange(char c, int i){
	if(c == '.') return '.';
	if(c == ' ') return ' ';
	return name[(index(c) + 26 - i) % 26];
}

bool search(string s, const string& t, int i){
	string t2;
	for(string::const_iterator iter = t.begin();
		iter != t.end(); iter++)
	{
		t2.push_back(rchange(*iter,i));
	}
	string::const_iterator it = search(s.begin(), s.end(), t2.begin(), t2.end());
	if(it != s.end()){
		if(it == s.begin() || it[-1] == ' ')
			if(it + t2.size() == s.end() || (it[t2.size()] == ' ' || it[t2.size()]))
				return true;
	}
	return false;
}

int main(){
	string s;
	const string t1("the"), t2("this"), t3("that");
	while(getline(cin, s)){
		int i = 0;
		for(; i < 26; i++){
			if(search(s, t1,i) || search(s, t2, i) || search(s, t3, i))
				break;
		}
		for(string::const_iterator it = s.begin();
			it != s.end(); it++)
		{
			cout << change(*it, i);
		}
		cout << endl;
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,maxe=0,co=0;;
    char str[82][82];
    for(int i=0;;i++){
        if(cin>>str[i]){

        }
        else break;
    }
    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<cstring>
using namespace std;
char a[53]="abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz";
int main(){
    char str[82];
    while(cin>>str[0]){
        for(int i=1;i<82;i++)str[i]=0;
        for(int i=1;i<80;i++){
            str[i]=getchar();
            if(str[i]==10)break;
        }
        int len=strlen(str);

        for(int i=0;i<=26;i++){
            char cpy[82];
            strncpy(cpy,str,82);

            for(int j=0;j<len;j++){
                if(str[j]==' ' || str[j]=='.' || str[j]==10)continue;
                cpy[j]=a[cpy[j]-'a'+i];
            }
            bool f=false;
            for(int j=0;j<len-3;j++){
                if(!strncmp(cpy+j,"the",3))f=true;
                if(!strncmp(cpy+j,"this",4))f=true;
                if(!strncmp(cpy+j,"that",4))f=true;
            }
            if(f){
                cout<<cpy<<endl;
                break;
            }
        }
    }
    return 0;


}

C++: #include <iostream>
#include <string>
#include <cstring>
using namespace std;
int main()
{
	char t[27][27] = {"bcdefghijklmnopqrstuvwxyza", "cdefghijklmnopqrstuvwxyzab", "defghijklmnopqrstuvwxyzabc",
		"efghijklmnopqrstuvwxyzabcd", "fghijklmnopqrstuvwxyzabcde", "ghijklmnopqrstuvwxyzabcdef",
		"hijklmnopqrstuvwxyzabcdefg", "ijklmnopqrstuvwxyzabcdefgh", "jklmnopqrstuvwxyzabcdefghi",
		"klmnopqrstuvwxyzabcdefghij", "lmnopqrstuvwxyzabcdefghijk", "mnopqrstuvwxyzabcdefghijkl",
		"nopqrstuvwxyzabcdefghijklm", "opqrstuvwxyzabcdefghijklmn", "pqrstuvwxyzabcdefghijklmno",
		"qrstuvwxyzabcdefghijklmnop", "rstuvwxyzabcdefghijklmnopq", "stuvwxyzabcdefghijklmnopqr",
		"tuvwxyzabcdefghijklmnopqrs", "uvwxyzabcdefghijklmnopqrst", "vwxyzabcdefghijklmnopqrstu",
		"wxyzabcdefghijklmnopqrstuv", "xyzabcdefghijklmnopqrstuvw", "yzabcdefghijklmnopqrstuvwx",
		"zabcdefghijklmnopqrstuvwxy"};
	char s[81], r[81];
	string u;
	int i, j;
	while (1)
	{
		cin.getline(s, sizeof(s));
		if (cin.eof()) break;
		for (i = 0; i < 27; i++)
		{
			for (j = 0; j < strlen(s); j++)
			{
				if ('a' <= s[j] && s[j] <= 'z')
					r[j] = t[i][(int)(s[j]-'a')];
				else
					r[j] = s[j];
			}
			r[strlen(s)] = '\0';
			u = r;
			if (u.find("the") != string::npos || u.find("this") != string::npos || u.find("that") != string::npos)
			{
				cout << u << endl;
				break;
			}
		}
	}
}

C++: #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iostream>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <numeric>
#include <algorithm>
#include <bitset>
#include <complex>
#include <fstream>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T> T RoundOff(T a){ return int(a+.5-(a<0)); }
template<class T, class C> void chmax(T& a, C b){ if(a < b) a = b; }
template<class T, class C> void chmin(T& a, C b){ if(b < a) a = b; }
template<class T, class C> pair<T, C> mp(T a, C b){ return make_pair(a, b); }


int main()
{
	string str;
	while(getline(cin, str))
	{
		rep(i, 26)
		{
			rep(j, str.size())
				if(str[j] != ' ' && str[j] != '.')
					str[j] = (++str[j] > 'z' ? 'a' : str[j]);
		
			if(str.find("the") != string::npos || str.find("this") != string::npos || str.find("that") != string::npos)
			{
				cout << str << endl;
				break;
			}
		}
	}
}

C++: //38
#include<iostream>
#include<string>
#include<cctype>

using namespace std;

int main(){
  for(string s;getline(cin,s);){
    for(;;){
      for(int i=0;i<s.size();i++){
	if(isalpha(s[i])){
	  s[i]++;
	  if(s[i]>'z'){
	    s[i]='a';
	  }
	}
      }
      if(s.find("the")!=string::npos||s.find("this")!=string::npos||s.find("that")!=string::npos)break;
    }
    cout<<s<<endl;
  }
  return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <string.h>
using namespace std;
int main(void) {
  string str;
  while(getline(cin, str)) {
    for(int a = 0 ; a < 26 ; a++) {
      
      for(int i = 0 ; i < str.size() ; i++) {
	if('a' <= str[i] && str[i] <= 'z') 
	  str[i] = (str[i] == 'z')? 'a' : str[i] + 1;
      }
      
      if(str.find("the") != string::npos ||
	 str.find("this") != string::npos ||
	 str.find("that") != string::npos) cout << str << endl;
    }
  }
  return 0;
}