Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func incrementByte(b byte) byte {
	if b >= 97 && b < 122 {
		return b + 1
	} else if b == 122 {
		return 97
	}
	return b
}

func main() {
	scanner.Split(bufio.ScanLines)

	for {
		line := nextString()
		if len(line) == 0 {
			break
		}
		for i := 0; i <= 26; i++ {
			decoded := []byte{}
			for j := 0; j < len(line); j++ {
				decoded = append(decoded, incrementByte(line[j]))
			}
			line = string(decoded)
			if strings.Contains(line, "the") || strings.Contains(line, "this") || strings.Contains(line, "that") {
				fmt.Println(line)
				break
			}
		}
	}
}

C++: //include
 //------------------------------------------
 #include <vector>
 #include <list>
 #include <map>
 #include <set>
 #include <deque>
 #include <stack>
 #include <bitset>
 #include <algorithm>
 #include <functional>
 #include <numeric>
 #include <utility>
 #include <sstream>
 #include <iostream>
 #include <iomanip>
 #include <cstdio>
 #include <cmath>
 #include <cstdlib>
 #include <cctype>
 #include <string>
 #include <cstring>
 #include <ctime>

 using namespace std;

 //conversion
 //------------------------------------------
 inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
 template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

 //math
 //-------------------------------------------
 template<class T> inline T sqr(T x) {return x*x;}

 //typedef
 //------------------------------------------
 typedef vector<int> VI;
 typedef vector<VI> VVI;
 typedef vector<string> VS;
 typedef pair<int, int> PII;
 typedef long long LL;
 typedef unsigned long long ULL;

 //container util
 //------------------------------------------
 #define ALL(a)  (a).begin(),(a).end()
 #define RALL(a) (a).rbegin(), (a).rend()
 #define PB push_back
 #define MP make_pair
 #define SZ(a) int((a).size())
 #define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
 #define EXIST(s,e) ((s).find(e)!=(s).end())
 #define SORT(c) sort((c).begin(),(c).end())

 //repetition
 //------------------------------------------
 #define FOR(i,a,b) for(int i=(a);i<(b);++i)
 #define REP(i,n)  FOR(i,0,n)

 //constant
 //--------------------------------------------
 const double EPS = 1e-10;
 const double PI  = acos(-1.0);

 //clear memory
 #define CLR(a) memset((a), 0 ,sizeof(a))

 //debug
 #define dump(x)  cerr << #x << " = " << (x) << endl;
 #define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

 int main() {
   int n;
   string str;

   while(getline(cin, str)) {
     for(int i = 0; i < str.size(); i++) {
       for(int j = 0; str[i]+j <= 'z'; j++) {
	 if(str[i] + j == 't' && str[i+1] + j == 'h') {
	   n = j;
	   break;
	 }
       } 
       for(int j = 0; str[i]-j >= 'a'; j++) {
	 if(str[i] - j == 't' && str[i+1] - j == 'h') {
	   n = -j;
	 break;
	 }
       }
     }
     
     for(int i = 0; i < str.size(); i++) {
       if(str[i] == ' ' || str[i] == '.' || str[i] == '\n') printf("%c", str[i]);
       else printf("%c", str[i]+n);
     }
     cout << endl;
   }
 }

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

using namespace std;

int main(int argc, const char * argv[])
{
    int shift = 0, i=0;
    string in,out;
    getline(cin,in);
    out = in;
    do {
        for (i=0; i<in.length(); i++) {
            if (in[i]!=' '&&in[i]!='.') {
                out[i] = ((in[i] - 'a' + shift) % 26) + 'a';
            }
        }
        if (out.find("the")!=std::string::npos||out.find("that")!=std::string::npos||out.find("this")!=std::string::npos) {
            break;
        }
        else
            shift++;
    } while (1);
    
    cout<<out;
    return 0;
}

C++: #include <iostream>
#include <string>
#define ALF 26
using namespace std;

int main(){
	string h[3] = {"the","that","this"};
	string s;
	while(getline(cin,s)){
	int c = 0;
	for(int j=0;j<ALF;j++){
		for(int m=0;m<3;m++){
			for(int k=0;k<=s.size()-h[m].size();k++){
				string t = s.substr(k,h[m].size());
				for(int l=0;l<h[m].size();l++) t[l] = (t[l]-'a'+j)%ALF + 'a';
				if(t==h[m]) c = j;
				cout << c << " " << t << " " << h[m] << endl;
			}
		}
	}
	for(int j=0;j<s.size();j++){
		if('a'<=s[j] and s[j]<='z') s[j] = (s[j]-'a'+c)%ALF + 'a';
	}
	cout << s << endl;
	}
}

C++: #include <bits/stdc++.h>
#include <vector>
using namespace std;
string str;	
int a, b, c, d;
int main(){
	while(getline(cin, str)){
		getline(cin, str);
		a = str.length();
		for(int i = 0; i < a; i++){
			if(str[i] < 97 || str[i] > 122){
				cout << str[i];
			}
			else {
				b = (int)str[i];
				b = b - 4;
				if(b < 97)
					b = b + 26;
				cout << (char)b;
			}
		}
		cout << endl;
	}
	return 0;
}

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

using namespace std;

int main(void) {
  string str;
  
  while(getline(cin, str)) {
    int cnt = 0;
    
    while(1) {
      for(int i=0; i<str.length(); i++)
	if(str[i] != ' ' && str[i] != '.') str[i] = (str[i]-'a' + 1)%26 + 'a';
      
      if(str.find("the") != string::npos || str.find("this") != string::npos || str.find("that") != string::npos) {
      	cout << str << endl;
	break;
      }
    }
    
  }
  return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
using namespace std;
typedef vector <string> vs;

vs split(const string &text, char delim=' '){
int start = 0, end = 0;
vs tokens;

for (int i=0; i<(int)text.size(); i++)
	if (text[i] == delim){
		end = i;
		tokens.push_back(text.substr(start, end - start));
		start = end + 1;
	}
	tokens.push_back(text.substr(start));
	return tokens;
}

int rot(string &text){
	for (int i=0; i<(int)text.size(); i++){
		char c=text[i];
		if (islower(c))
			if (c=='z') text[i]='a';
			else text[i]++;
	}
	return 0;
}

bool check(string text){
	vs words = split(text);
	for (int i=0; i<(int)words.size(); i++){
		string tmp = words[i];
		if (tmp=="the" || tmp=="this" || tmp=="that")
			return true;
	}
	return false;
}

int main(void){
	string text;
	while (true){
		getline(cin, text);
		if (cin.eof()) break;
		for (int i=0; i<26; i++){
			if (check(text)) break;
			else rot(text);
		}
		cout<<text<<endl;
	}
	return 0;
}

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

using namespace std;

int shift(const char* str, int len) {
	char t, h;
	char e, i, a, s;
	int dis;

	for (int pos = 0; pos < len - 1; pos++) {
		if (*(str + 1) == ' ' || *(str + 1) == '.' || *(str + 1) == ',') {
			pos += 2;
			continue;
		}
		t = *(str) - 'a';
		h = *(str + 1) - 'a';
		dis = (t > h) ? (t - h) : (t - h + 26);

		if (dis == 12) {
			e = (h - 3 + 26) % 26;
			i = (h + 1) % 26;
			s = (t - 1 + 26) % 26;
			a = (h - 7 + 26) % 26;

			if ((len > pos + 2 && *(str + pos + 2) == (e + 'a')) ||
				(len > pos + 3 && *(str + pos + 2) == (i + 'a') && *(str + pos + 3) == (s + 'a')) ||
				(len > pos + 3 && *(str + pos + 2) == (a + 'a') && *(str + pos + 3) == (t + 'a'))) {
				return (t - 19 + 26) % 26;
			}
		}
	}
	return -1;
}

int main(int argc, char* argv[])
{
	int s;
	std::string str;

	while (std::getline(cin, str)) {
		s = shift(str.c_str(), str.length());
		if (s == -1) continue;
		for (int i = 0; i < str.length(); i++) {
			printf("%c", (str[i] == ' ' || str[i] == '.' || str[i] == ',') ? str[i] : (char)('a' + ((str[i] - 'a' - s + 26) % 26)));
		}
		printf("\n");
	}
	return 0;
}