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>
#include <sstream>

using namespace std;

const string LIST[3] = {"the", "this", "that"};

bool judge(string);

int main(void){
	for(string input; getline(cin, input); cout << input << endl){
		for(int i = 0; i < 25; i ++){
			if(judge(input)) break;
			for(int j = 0; j < input.length(); j ++){
				if('a' <= input[j] && input[j] <= 'z')
					input[j] = (input.at(j) != 'z') ? input.at(j) + 1: 'a';
			}
		}
	}

	return 0;
}

bool judge(string input){
	istringstream iss(input);
	do{
		string sub;
		iss >> sub;
		for(int i = 0; i < 3; i ++)
			if(sub == LIST[i]) return true;
	} while(iss);

	return false;
}

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

using namespace std;

char Shift(int, char);

int main(){
  int i, n;
  string str, _str;
  string The = "the", This = "this", That = "that";
  string::iterator iter1, iter2, iter3;

  while(getline(cin, str)){
    n=1;
    while(1){
      _str = str;
      for(i=0; i<_str.size(); i++)
	_str[i] = Shift(n, _str[i]);

      iter1 = search(_str.begin(), _str.end(), The.begin(), The.end());
      iter2 = search(_str.begin(), _str.end(), This.begin(), This.end());
      iter3 = search(_str.begin(), _str.end(), That.begin(), That.end());

      if(iter1 != _str.end() || iter2 != _str.end() || iter3 != _str.end())
	break;

      n++;
    }

    cout << _str << endl;
  }

  return 0;
}

char Shift(int n, char c){
  int x;
  if(c >= 'a' && c <= 'z'){
    x = c + n;
    if(x > 122) x -= 26;
    c = x;
  }
  return c;
}

C++: 
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <stack>
#include <cctype>
#include <complex>
#include <vector>
#include <algorithm>

using namespace std;


bool solve(){
	string str[1000];
	int num=0;
	int k=0;
	while(cin>>str[k]){
		for(int j=0;j<26;j++){
			string str2 = str[k];
			for(int i=0;i<str2.size();i++){
				int cnt=j;
				while(cnt){
					if(str2[i]=='a'){
						str2[i]='z';
					}else{
						str2[i]--;
					}
					cnt--;
				}
			}
//			if(k==0) cout<< str2<<endl;
			if(str2=="the" || str2=="this" || str2=="that"){
				num = j;
				break;
			}
		}
		k++;
	}
	for(int j=0;j<k;j++){
		for(int i=0;i<str[j].size();i++){
			int cnt = num;
			while(cnt){
				if(str[j][i]=='.'){
				}else if(str[j][i]=='a'){
					str[j][i]='z';
				}else{
					str[j][i]--;
				}
				cnt--;
			}
		}
		cout<<str[j];
		if(j!=k-1){
			cout<<" ";
		}else{
			cout<<endl;
		}
	}
	
	return true;
}

int main(){
	cout.setf(ios::fixed);
	cout.precision(10);
	solve();

	return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <cstring>
#include <functional>

using namespace std;

#define REP(i,a,b) for((i)=(a);(i)<(int)(b);(i)++)
#define rep(i,n) REP(i,0,n)
// BEGIN CUT HERE
#define foreach(itr,c) for(typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
template<class T> inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}
// END CUT HERE

int main(){
  int i, j, c;
  string str;

  while(getline(cin,str)){
    int N = str.size();

    rep(c,26){
      rep(i,N) if(str[i] != '.' && str[i] != ' '){
          str[i]--;
          if(str[i] < 'a') str[i] = 'z';
      }
 
      rep(i,N){
        if(str.find("this") != -1 || str.find("the") != -1 || str.find("that") != -1){
          cout << str << endl;
          return 0;
        }
      }
    }
  }

  return 0;
}

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

using namespace std;

int main(int argc, char *argv[]) {
  string str, copy;
  int shif;
  vector<string> result;
  while (getline(cin, str)) {
    copy = str;
    shif = -1;
    while (true) {
      if (str.find(" this ") != string::npos ||
          str.find(" that ") != string::npos ||
          str.find(" the ") != string::npos)
        break;
      else
        for (string::iterator itr = str.begin();
             itr != str.end();
             itr++)
          if ('a' <= *itr && *itr <= 'z') {
            *itr += shif;
          } else if (*itr != '.' && *itr != ' ' &&
                     *itr != '\n') {
            str = copy;
            shif = 1;
            break;
          }
    }
    result.push_back(str);
  }

  for (int i = 0; i < result.size(); i++)
    cout << result[i] << endl;
  return 0;
}

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

using namespace std;

void forward(string& data)
{
	for(auto& c : data)
	{
		if(c < 'a' || 'z' < c)
			continue;

		c++;
		if('z' < c)
			c -= 26;
	}
}

bool test(const string& data)
{
	if(data.find("the") != string::npos)
		return true;
	if(data.find("this") != string::npos)
		return true;
	if(data.find("that") != string::npos)
		return true;

	return false;
}

int main()
{
	while(!cin.eof())
	{
		char buffer[1024];
		cin.getline(buffer, 1024);
		string line(buffer);

		for(int i = 0; i < 26; i++)
		{
			if(test(line))
				break;
			forward(line);
		}

		cout << line << endl;
	}

	return 0;
}

C++: #include<iostream>
#include<iterator>
#include<sstream>
#include<vector>
#include<cstdio>
const int A_SIZE=26;
using namespace std;
bool is_the(string str){
  if(str.size()!=3){return false;}
  if((str[0]-str[1]+A_SIZE)%A_SIZE!=('t'-'h'+A_SIZE)%A_SIZE){return false;}
  if((str[1]-str[2]+A_SIZE)%A_SIZE!=('h'-'e'+A_SIZE)%A_SIZE){return false;}
  return true;
}
bool is_that(string str){
  if(str.size()!=4){return false;}
  if((str[0]-str[1]+A_SIZE)%A_SIZE!=('t'-'h'+A_SIZE)%A_SIZE){return false;}
  if((str[1]-str[2]+A_SIZE)%A_SIZE!=('h'-'a'+A_SIZE)%A_SIZE){return false;}
  if((str[2]-str[3]+A_SIZE)%A_SIZE!=('a'-'t'+A_SIZE)%A_SIZE){return false;}
  return true;
}
bool is_this(string str){
  if(str.size()!=4){return false;}
  if((str[0]-str[1]+A_SIZE)%A_SIZE!=('t'-'h'+A_SIZE)%A_SIZE){return false;}
  if((str[1]-str[2]+A_SIZE)%A_SIZE!=('h'-'i'+A_SIZE)%A_SIZE){return false;}
  if((str[2]-str[3]+A_SIZE)%A_SIZE!=('i'-'s'+A_SIZE)%A_SIZE){return false;}
  return true;
}
bool is_clue(string str){
  return is_the(str) || is_that(str) || is_this(str);
}

int main(){
  char str[80];
  while(cin.getline(str,80)!=0){
    istringstream iss{str};
    vector<string> strs;
    copy(istream_iterator<string>(iss), istream_iterator<string>(), back_inserter(strs));
    int offset=0;
    for(string a : strs){
      if(is_clue(a)){
	offset = 't'-a[0];
	break;
      }
    }
    for(char c : str){
      if(c=='\0'){putchar('\n');break;}
      if(c<'a'||c>'z'){putchar(c);}
      else if(c+offset>'z'){putchar(c+offset-A_SIZE);}
      else if(c+offset<'a'){putchar(c+offset+A_SIZE);}
      else{putchar(c+offset);}
    }
  }
}