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<vector>
#include<string>
using namespace std;

string Caesar(string a) {
	for (int b = 0; b < a.length(); b++) {
		if (a[b] == 'z')a[b] = 'a';
		else if (a[b] >= 'a'&&a[b] < 'z')a[b] = a[b] + 1;
	}
	return a;
}
int main() 
{
	string a;
	while (getline(cin, a)) {
		for (int b = 0; b < 26; b++) {
		    a=Caesar(a);
			for (int c = 0; c < a.length() - 4; c++) {
				if (a[c] == 't'&&a[c + 1] == 'h') {
					if (a[c + 2] == 'e') { cout << a << endl; goto l; }
					else	if (a[c + 2] == 'a'&&a[c + 3] == 't') { cout << a << endl; goto l; }
					else	if (a[c + 2] == 'i'&&a[c + 3] == 's') { cout << a << endl; goto l; }
				}
			}
			if(a[a.length()-1]=='t'&&a[a.length() - 2] == 'h'&&a[a.length() - 3] == 'e') { cout << a << endl; break; }
		l:;
		}
	}
}

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

using namespace std;

char returnc(char c){
  if('a'<=c && c<='z'){
    if(c=='z')return 'a';
    return ++c;
  }
  return c;
}
int main(void){
  vector<string> ss;
  string s,str;
  while(getline(cin,s)){
  s+= " ";
  for(int i = 0 ; i < s.size() ; i ++){
    if(s[i] == ' '){
      ss.push_back(str);
      str="";
    }else{
      str+=s[i];
    }
  }
  bool ok=true;
  string out[] = {"this","that","the"};
  while(ok){
    for(int i = 0 ; i < ss.size(); i ++){
      //cout<<ss[i]<<endl;
      for(int j = 0 ; j < ss[i].size() ; j ++){
	ss[i][j] = returnc(ss[i][j]);
      }
      for(int j = 0 ; j < 3 ; j ++){
	if(ss[i] == out[j])ok=false;
      }
    }
  }
  for(int i = 0 ; i < ss.size()-1 ; i ++){
    cout<<ss[i]<<" ";
  }
  cout<<ss[ss.size() - 1]<<endl;
  }
}

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[100];
	int num=0;
	int k=0;
	while(cin>>str[k]){
		if(!num){
			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 <stdio.h>
#include <string.h>

char buf[99];

int main(){
    int i;

    for(;~scanf("%[^\n] ",buf);){
        for(i=0;;i++){
            if( buf[i]-buf[i+1]==12 || buf[i]-buf[i+1]==-14 ){
                break;
            }
        }
        int sa = buf[i] - 't';
        for(i=0; buf[i]!='\0'; i++){
            buf[i]=!putchar( buf[i] - (97>buf[i] ? 0: sa) );
        }
        puts("");
    }
    return 0;
}

C++: #include <iostream>
#include <string>
#include <cstring>
using namespace std;

int main() {
  char buf[82];
  char *p;
  int l;
  string str;

  cin.getline(buf, 82);
  l = strlen(buf);

  for (int i=0; i<26; i++) {
    for (int j=0; j<l; j++) {
      if (buf[j]>='a' && buf[j]<='z') {
        buf[j] = (buf[j]-'a'+1)%26 + 'a';
      }
    }
    str.assign(buf);
    if (str.find("the")!=string::npos ||
        str.find("this")!=string::npos ||
        str.find("that")!=string::npos) {
      break;
    }
  }

  cout << str;
  return 0;
}

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

using namespace std;

//the this that を探す
bool found(string s){
	if ((s.find("the") != -1) || (s.find("this") != -1) || (s.find("that") != -1))
		return true;
	else
		return false;
}


int main(){

	
	string str;
	getline(cin, str);
	string ans=str;

	int j = 0;

	while (!found(ans)){
		j++;
		for (int i = 0; i < str.size(); i++){
			if 
				(ans[i] == ' ') ans[i] = ans[i];
			else if 
				(ans[i] == '.') ans[i] = ans[i];
			else
				ans[i] = ((int)str[i] + j)>(int)'z' ? (char)((int)str[i] + j - 26) : (char)((int)str[i] + j);
		}
		if(found(ans)) break;
	} 
	
	cout << ans << endl;

	return 0;

}

C++: #include <fstream>
#include <iostream>
#include <cmath>
#include <vector>
#include <queue>
#include <utility>
#include <algorithm>
using namespace std;

char shift(char c, int n) {
  if (c >= 'a' && c <= 'z')
    return (c + n <= 'z') ? c + n : 'a' + (c + n - 'z' - 1);
  else
    return c;
}

bool exist(string str, string c) {
  return str.find(c, 0) != string::npos;
}

int main() {
  // ifstream cin("../test.txt");
  vector<string> _the(26);
  vector<string> _this(26);
  vector<string> _that(26);
  _the[0] = "the";
  _this[0] = "this";
  _that[0] = "that";
  for (int i = 1; i < 26; i++) {
    for (int j = 0; j < 3; j++) {
      _the[i] += shift(_the[0][j], i);
    }
    for (int j = 0; j < 4; j++) {
      _this[i] += shift(_this[0][j], i);
      _that[i] += shift(_that[0][j], i);
    }
  }

  string str, nstr;
  while (getline(cin, str)) {
    for (int i = 1; i < 26; i++) {
      if ( exist(str, _the[i]) || exist(str, _this[i]) || exist(str, _that[i])) {
        nstr = "";
        int len = str.length();
        for (int j = 0; j < len; j++) {
          nstr += shift(str.at(j), 26 - i);
        }
        break;
      }
    }

    cout << nstr << endl;
  }
}

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

using namespace std;

void solve()
{
	string str;
	getline(cin, str);
	string word;
	int n = str.size();
	for(int j = 1; j < 26; ++j)
	{
		word.clear();
		for(int i = 0; i < n; ++i)
		{
			if('a' <= str[i] && str[i] <= 'z')
			{
				word += (str[i] + j -'a') % 26 + 'a';
			}
			else
			{
				word += str[i];
			}
		}
		if(word.find("this") != -1 && word.find("the") != -1 && word.find("that") != -1)
		{
			cout << word << endl;
		}
	}
}

int main()
{
	solve();
	return(0);
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <set>
#include <cmath>
#include <algorithm>
using namespace std;

bool islower(char a){
	if(a>='a' && a<='z') return true;
	else return false;
}

int main(){
	string s,ans;
	while(getline(cin,s)){
		int shift=1;
		ans=s;
		while(1){
			if(ans.find("the" ,0)!=string::npos || ans.find("this",0)!=string::npos || ans.find("that",0)!=string::npos) break;
			for(int i=0;i<s.size();++i){
				if(islower(s[i])){
					if(s[i]+shift<='z'){
						ans[i]=s[i]+shift;
					} else {
						ans[i]=s[i]-26+shift;
					}
				}
			}
			shift++;
		}
		cout << ans << endl;
	}
	return 0; 
}