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

using namespace std;

string
caesar (string str, int n)
{
  const string table = "abcdefghijklmnopqrstuvwxyz";
  string ans (str.length (), ' ');
  for (int i = 0; i < str.length (); i++)
    {
      int buf = table.find (str[i]);
      if (buf == string::npos)
	{
	  ans[i] = str[i];
	}
      else
	{
	  ans[i] = (buf + n < table.length ())? table[buf + n]
	    : table[buf + n - table.length ()];
	}
    }
  return ans;
}

int
main ()
{
  string str;
  while (getline (cin, str))
    {
      string after;
      for (int i = 0; i <= 25; i++)
	{
	  after = caesar (str, i);
	  if (after.find ("the") != string::npos)
	    break;
	  if (after.find ("this") != string::npos)
	    break;
	  if (after.find ("that") != string::npos)
	    break;
	}
      cout << after << endl;
    }
}

C++: #include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <deque>
#include <list>
#include <string>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <stdio.h>

using namespace std;

int pat[3][3];
int len[3];
int chr[3];
int zure;
int size;
bool atteru[3];
char text[100];

int main() {
	//cin >> text;
	gets(text);
	//int size = text.size();
	int pt = 0;
	size = 100;

	pat[0][0] = 't' - 'h';
	pat[0][1] = 'h' - 'e';
	pat[1][0] = 't' - 'h';
	pat[1][1] = 'h' - 'i';
	pat[1][2] = 'i' - 's';
	pat[2][0] = 't' - 'h';
	pat[2][1] = 'h' - 'a';
	pat[2][2] = 'a' - 't';
	chr[0] = 'e';
	chr[1] = 's';
	chr[2] = 't';
	len[0] = 3;
	len[1] = 4;
	len[2] = 4;

	for (int i = 0; i < 3; i++) {
		for (int j = 0; j < 3; j++) {
			if (pat[i][j] < 0) pat[i][j] += 26;
		}
	}

	zure = -1;

	int cnt = 0;
	atteru[0] = true;
	atteru[1] = true;
	atteru[2] = true;
	for (int i = 0; i < size-1 && zure == -1; i++) {
		if (text[i+1] == ' ' || cnt > 3) continue;
		if (text[i] == ' ') {
			cnt = 0;
			atteru[0] = true;
			atteru[1] = true;
			atteru[2] = true;
			//cout << "yarinaoshi!" << endl;
			continue;
		}
		int dist = text[i] - text[i+1];
		if (dist < 0) dist += 26;
		for (int j = 0; j <= 2; j++) {
			if (!atteru[j]) continue;
			if (cnt >= len[j]-1) continue;
			if (dist != pat[j][cnt]) {
				atteru[j] = false;
				//cout << j << " ha tigau!" << endl;
				continue;
			} else if (cnt == len[j]-2) {
				//cout << j << " ha atteta!" << endl;
				zure = text[i+1] - chr[j];
				if (zure < 0) zure += 26;
				//cout << "zure = " << zure << endl;
			}
		}
		cnt++;
	}

	for (int i = 0; i < size; i++) {
		if (text[i] == '.') break;
		if (text[i] == ' ') continue;
		text[i] = text[i] - zure;
		if (text[i] < 'a') text[i] += 26;
	}

	cout << text << endl;

	return 0;
}

/*@@@@@@@@@@@@@@@@@@@@@@@@@*/
/*@                       @*/
/*@ debug output erased ? @*/
/*@                       @*/
/*@@@@@@@@@@@@@@@@@@@@@@@@@*/

C++: #include<iostream>
#include<string>
using namespace std;
main(){
	string str;
	int tmp,b;
	while(getline(cin,str)){
		tmp='t'-str[0];
		for(int i=0;i<str.size();++i){
			if(str[i]>='a' && str[i]<='z'){
				if(str[i]>='m')str[i]-=26;
				str[i]+=tmp;
				if(str[i]<'a')str[i]+=26;
				else if(str[i]>'z')str[i]-=26;
			}
		}
		string str2="";
		for(int i=0;i<=4;++i){
			if(str[i]>='a' && str[i]<='z')str2+=str[i];
			else break;
		}
		if(str2=="this" || str2=="the" || str2=="that")cout<<str<<endl;
	}
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<vector>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
int main()
{
	string s;
	while(1)
	{
		getline(cin,s);
		if(cin.eof())break;
		int slidenum=0,len = s.size();
		string ss = s;
		rep(i,26)
		{
			rep(j,len)
			{
				if(s[j]>='a' && s[j]<='z'){ss[j] = ((s[j] - 'a' + i) % 26) +'a';}
			}
			int index[3];
			index[0] = ss.find("this");
			index[1] = ss.find("that");
			index[2] = ss.find("the");
			
			if(index[0]!=string::npos || index[1]!=string::npos || index[2]!=string::npos)break;
		}
		cout << ss<<endl;
	}

	return 0;
}

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

using namespace std;

int main()
{
	string s;
	int pl;
	while(getline(cin,s))
	{
		if(s=="\n" && s=="EOF") 
			break;

		pl = 0;

		for(int i =-30;i<30;i++)
		{
			for(int j = 0; j < s.size()-3; j++)
			{
				if(s[j]+i=='t' &&s[j+1]+i == 'h' && s[j+2]+i == 'e')
				{
					pl = i;
					break;
				}

				if(j==s.size()-1) 
					break;

				if(s[j]+i=='t' &&s[j+1]+i == 'h' && s[j+2]+i == 'a' && s[j+3]+i=='t')
				{
					pl = i;
					break;
				}

				if(s[j]+i=='t' &&s[j+1]+i == 'h' && s[j+2]+i == 'i' && s[j+3]+i=='s')
				{
					pl = i;
					break;
				}
			}

			if(pl!=0) 
				break;
		}

		for(int i=0;i <s.size();i++)
		{
			if(s[i] >= 'a' && s[i] <= 'z')
			{
				s[i] += pl;
				if(s[i] > 'z')
				{
					s[i] -= 'z' - 'a';
				}
				if(s[i] < 'a')
				{
					s[i] += 'z' - 'a';
				}
			}
		}

		cout<<s<<endl;
	}
}

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

using namespace std;

void split(string s,vector<string> *a)
{
	string tmp;
	for(int i=0;i<s.length();i++)
	{
		if(s[i]!=' ')
		{
			tmp.append(1,s[i]);
		}
		else
		{
			a->push_back(tmp);
			tmp.clear();
		}
	}
	a->push_back(tmp);
}

bool judge(vector<string> str)
{
	for(int i=0;i<str.size();i++){
		if(str[i].compare("the")==0||
			str[i].compare("this")==0||
			str[i].compare("that")==0)
		{
			return false;
		}
	}
	return true;
}

void rotate(string *s)
{
	for(int i=0;i<s->length();i++)
	{
		if('a'<=s->at(i)&&s->at(i)<='z')
		{
			if(s->at(i)=='z')
			{
				s->at(i)='a';
			}
			else
			{
				s->at(i)+=1;
			}
		}
	}
}

int main(void)
{
	string line;
	while(getline(cin,line))
	{
		vector<string> str;
		split(line,&str);
		while(judge(str))
		{
			for(int i=0;i<str.size();i++)
			{
				rotate(&str[i]);
			}
		}
		cout<<str[0];
		for(int i=1;i<str.size();i++)
		{
			cout<<" "<<str[i];
		}
		cout<<endl;
	};
}