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 <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;
}

C++: //#define _USE_MATH_DEFINES
//#include <cmath>
#include <iostream>
//#include <stdio.h>
//#include <stdlib.h>
//#include <iomanip>
#include <vector>
#include <string>
//#include <algorithm>
//#include <functional>
//#include <time.h>
#include <sstream>

using namespace std;

bool isthe(string str){
	//?????????????????????????????? the this that?????¢??? ????????°ture

	int d1, d2, d3;

	d1 = (str[1] - str[0] + 26) % 26;

	if (d1 != 14){
		return false;
	}
	else{
		d2 = (str[2] - str[0] + 26) % 26;
		if (d2 != 11 && d2 != 15 && d2 != 7){
			return false;
		}
		else{
			if (d2 == 11 && str.size() == 3){
				return true;
			}
			else{
				d3 = (str[3] - str[0] + 26) % 26;
				if (d2 == 15 && d3 == 25) return true;
				if (d2 == 7 && d3 == 26) return true;
			}
		}
	}

	return false;

}


int main(){
	
	string s,sc, buf;
	stringstream ss;
	vector <string> as;
	int dif = 0;


	while (getline(cin, s)){
		dif = 0;
		buf = "";
		sc = "";
		ss.str("");
		ss.clear();

		sc += s;
		for (int i = 0; i < sc.size(); i++){
			if (sc[i] == '.')sc[i] = ' ';
		}
		ss << sc;

		while (ss >> buf){
			//the this that???????´¢
			if (buf.size() == 3 || buf.size() == 4){
				if (isthe(buf)){
					dif = buf[0] - 't';
					break;
				}
			}
		}

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

		cout << s << endl;
	}




	return 0;
}

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

int main(){
	char s[100];

	int count = 0;

	gets(s);

	int diff;
	int flag = false;
	//一番最初に｛the,that,this｝がある場合
	diff = s[0] - 't';
	if ((s[1] - diff) == 'h'){
		//printf("%c\n", s[j+1] - diff);
		if ((s[2] - diff) == 'e'){
			//printf("%c\n", s[j + 2] - diff);
			if (s[3] == ' '){
				flag = true;
			}
		}
		else if ((s[2] - diff) == 'a'){
			//printf("%c\n", s[j + 2] - diff);
			if ((s[3] - diff) == 't'){
				//printf("%c\n", s[j + 3] - diff);
				if (s[4] == ' '){
					flag = true;
				}
			}
		}
		else if ((s[2] - diff) == 'i'){
			//printf("%c\n", s[j + 2] - diff);
			if ((s[3] - diff) == 's'){
				//printf("%c\n", s[j + 3] - diff);
				if (s[4] == ' '){
					flag = true;
				}
			}
		}
	}
	
	if (!flag){
		//一番以降に｛the,that,this｝がある場合
		for (int j = 1; j < strlen(s); j++){
			if ((s[j]) == ' '){
				diff = s[j + 1] - 't';
				if ((s[j + 1] - diff) == 't'){
					//printf("diff:%d\n", diff);
					if ((s[j + 2] - diff) == 'h'){
						//printf("%c\n", s[j+1] - diff);
						if ((s[j + 3] - diff) == 'e'){
							//printf("%c\n", s[j + 2] - diff);
							if (s[j + 4] == ' '){
								break;
							}
						}
						else if ((s[j + 3] - diff) == 'a'){
							//printf("%c\n", s[j + 2] - diff);
							if ((s[j + 4] - diff) == 't'){
								//printf("%c\n", s[j + 3] - diff);
								if (s[j + 5] == ' '){
									break;
								}
							}
						}
						else if ((s[j + 3] - diff) == 'i'){
							//printf("%c\n", s[j + 2] - diff);
							if ((s[j + 4] - diff) == 's'){
								//printf("%c\n", s[j + 3] - diff);
								if (s[j + 5] == ' '){
									break;
								}
							}
						}

					}
				}
			}
		}
	}
	//printf("diff:%d\n",diff);
	for (int i = 0;i < strlen(s);i++){
		if (s[i] == ' ' || s[i] == '.')continue;
		s[i] -= diff;
	}

	printf("%s\n",s);

	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define all(c) (c).begin(),(c).end()
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define iter(c) __typeof((c).begin())
#define tr(it,c) for(iter(c) it=(c).begin(); it!=(c).end(); it++)
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define pr(a) cout << (a) << endl
typedef long long ll;
typedef pair<int,int> P;
const int MAX=1000000000;
int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

string change(string s,int k) {
  for(int i=0; i<s.size(); i++) {
    if(s[i]=='.' || s[i]==' ') continue;
    s[i]+=k;
    if(s[i]<'a') s[i]+=26;
    if(s[i]>'z') s[i]-=26;
  }
  return s;
}

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

bool check(string s) {
  for(int i=0; i<3; i++) {
    for(int j=0; j<s.size()-a[i].size(); j++) {
      if(s.substr(j,a[i].size())==a[i]) return true;
    }
  }
  return false;
}

int main() {
  string s;
  while(getline(cin,s)) {
    for(int k=0; k<26; k++) {
      s=change(s,1);
      if(check(s)) {
	pr(s);
	break;
      }
    }
  }
  return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main(){
  string s;
  int pl=0;
  getline(cin,s);
  for(int i =-27;i<27;i++){
    for(int j = 0; j < s.size(); j++){
      if(s[j]+i=='t' &&s[j+1]+i == 'h' && s[j+2]+i == 'e'){
	pl = i;
	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;
  }
  cout<<pl<<endl;
  for(int i=0;i <s.size();i++){
    if(s[i]<='z' && s[i]>='a') s[i] += pl;
  }
  cout<<s<<endl;
}