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;
bool isAlpha(char c){
	return ('a' <= c && c <= 'z');
}
int getShiftVal(string& line){
	int s = line.size();
	string::size_type ps = 0, pe = 0;
	while (true){
		while (ps < s && !isAlpha(line[ps])) ++ps;
		pe = ps;
		while (pe < s && isAlpha(line[pe])) ++pe;
		if (ps >= s || pe >= s)
			break;
		int len = pe - ps;
		if (3 == len){
			if (line[ps] == line[ps + 1] + 12 && line[ps] == line[ps + 2] + 15){
				return int('t' - char(line[ps]));
			}
		}
		else if (4 == len){
			if (line[ps] == line[ps + 1] + 12 && line[ps] == line[ps + 2] + 11 && line[ps] == line[ps + 3] + 1){
				return int('t' - char(line[ps]));
			}
			else if (line[ps] == line[ps + 1] + 12 && line[ps] == line[ps + 2] + 19 && line[ps] == line[ps + 3]){
				return int('t' - char(line[ps]));
			}
		}
		ps = pe;
	}
	return -1;
}

int main()
{
	string line;
	while (std::getline(cin, line)){
		int s = line.size();
		int v = getShiftVal(line);
		for (int i = 0; i < s; ++i){
			char c = line[i];
			if (isAlpha(c)) cout << char(c + v);
			else cout << c;
		}
		cout << "\n";
	}
	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' + 26)%26;
					//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<cstdio>
#include<cstring>
#include<string>
using namespace std;

int main(){

  int n;
  string s;
  int k;

  getline(cin,s);

  for(int i=-25;i<26;i++){
    bool d = false;
 
    for(int j=0;j<s.size()-3;j++){

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

      if(d == true) break;
    }

    if(d == true){
      k = i;
      break;
    }

  }

  for(int i=0;i<s.size();i++){
    if(s[i] >= 'a' && s[i] <= 'z') printf("%c",s[i]+k);
    else printf("%c",s[i]);
  }

  cout << endl;
}

C++: #include <cstdio>
#include <cstring>
#include <cctype>

int main(void) {
    char str[81];
    while(gets(str)) {
        while(!strstr(str, "this") && !strstr(str, "that") && !strstr(str, "the")) {
            for(int r = 0; r < strlen(str); r++) {
                if(isalpha(str[r])) {
                    str[r] = 'a' + (str[r] - 'a' + 1) % 26;
                }
            }
        }
        printf("%s\n", str);
    }
    return(0);
}

C++: #include <iostream>
#include <string.h>
#include <string>
#include <stdio.h>
using namespace std;
int main() {
	string w[3]={"the","this","that"},st;
	int wn[3]={3,4,4},k,i,j,s,f;
	while(getline(cin,st)) {
    k=0; 
	while(k<st.size()) {
		for (i=0;i<3;i++) {
			s=0; f=0;
			if (st.size()<k+wn[i]) break;
			for (j=0;j<wn[i]-1;j++) if ((w[i][j]-w[i][j+1])==(st[k+j]-st[k+j+1])) s++;
			if (s==wn[i]-1)  { f=1; i=5;}
		}
		if (f==1) break;
		for (k;st[k]>='a' && st[k]<='z' && k<80; k++);
		k++;
	}
	if (f==0) cout << st; else {
		for (i=0;i<st.size();i++) 
			if ((st[i]>='a' && st[i]<='z')) cout << (char)(((st[i]-st[k]+'t')-97+26) % 26 + 97) ; 
		    else cout << st[i];
	}
	cout << endl;
	}
	return 0;
	}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <sstream>      // std::ostringstream
std::vector<std::string> split(const std::string &str, char sep)
{
	std::vector<std::string> v;
	std::stringstream ss(str);
	std::string buffer;
	while (std::getline(ss, buffer, sep)) {
		v.push_back(buffer);
	}
	return v;
}
using namespace std;
int main() {
	string str;
	string w[3] = { "the","this",  "that" };
	while (true) {
		getline(cin, str);

		if (str == "")break;

		vector<string> v = split(str, ' ');

		int key;
		bool f = false;

		v[v.size() - 1].pop_back();

		for (int i = 0; i < v.size();i++) {
			for (int j = 1; j < 26;j++) {
				string temp;
				for (int k = 0; k < v[i].size();k++) {
					temp += (v[i][k] - 'a' + j) % 26 + 'a';
				}
				for (int k = 0; k < 3;k++) {
					if (temp == w[k]) {
						f = true;
						key = j;
						break;
					}
				}
				if (f)break;
			}
			if (f)break;
		}

		for (int i = 0; i < v.size();i++) {
			for (int k = 0; k < v[i].size();k++) {
				cout << char((v[i][k] - 'a' + key) % 26 + 'a');
			}
			if (i == v.size() - 1) {
				cout << ".";
			}
			else {
				cout << " ";
			}
		}
		cout << endl;
	}
}

C++: 

#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(i=0;i<n;i++)
#define loop(i,a,n) for(i=a;i<n;i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

typedef vector<int> vi;
typedef pair<int,int> pii;

int main(void) {
  int i,j,k;
  string s;
  char ans[6][10]={"the","the.","this","this.","that","that."};
  while(getline(cin,s)){
    int n=0;
    rep(i,s.size())if(s[i]==' ')n++;
    n++;
    vector<string> word(n);
    i=0;
    rep(j,n){
      while(s[i]!=' '&&s[i]!='\0')
	word[j].push_back(s[i]),i++;
      i++;
    }
    rep(k,26){
      bool c=false;
      rep(i,n)rep(j,word[i].size())
	if(word[i][j]=='z')word[i][j]='a';
	else if(word[i][j]<='z' && word[i][j]>='a')
	  word[i][j]=word[i][j]+1;
      rep(i,n)rep(j,6)
	if(word[i]==ans[j]){
	  c=true;
	}
      if(c){
	rep(i,n){
	  if(i)cout<<" ";
	  cout<<word[i];
	}
	cout<<endl;
	break;
      }
    }
  }
}