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 <string>
#include <sstream>
#include <iostream>
#include <algorithm>
using namespace std;

// determine whether it is "the","this" or "that"
char is_article(string w) {
	char sh = '\0'; // shift defaults to 0
	if (w.size() == 3) {
		sh = 't' - w.front();
		for_each(w.begin(),w.end(),[sh](char &c) {
			c += sh;
			if (c > 'z') {
				c -= 'z'-'a'+1;
			} else if (c < 'a') {
				c += 'z'-'a'+1;
			}
		});
		if (w != "the") {
			sh = '\0';
		}
	} else if (w.size() == 4) {
		sh = 't' - w.front();
		for_each(w.begin(),w.end(),[sh](char &c) {
			c += sh;
			if (c > 'z') {
				c -= 'z'-'a'+1;
			} else if (c < 'a') {
				c += 'z'-'a'+1;
			}
		});
		if (w != "this" && w != "that") {
			sh = '\0';
		}
	}
	return sh;
}

int main() {
	string s;
	while (getline(cin,s)) {
		istringstream stream(s);
		string w;
		char sh;
		while (stream >> w) {
			if ((sh = is_article(w)) != '\0') {
				break;
			}
		}
		for_each(s.begin(),s.end(),[sh](char &c) {
			if (c >= 'a' && c <= 'z') {
				c += sh;
				if (c > 'z') {
					c -= 'z'-'a'+1;
				} else if (c < 'a') {
					c += 'z'-'a'+1;
				}
			}
		});
		cout << s << endl;
	}
}

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

bool isSmallAlphabet(char ch) {
  /* a ~ z(ascii) : 97 ~ 122 */
  if('a' <= ch && ch <= 'z') return true;
  else return false;
}

bool isHit(string str) {
  if(str.find("the") != str.npos) return true;
  else if(str.find("this") != str.npos) return true;
  else if(str.find("that") != str.npos) return true;
  else return false;
}

/* ????????¶??????????§£??? */
void CaesarCipher(string _str) {
  
  /* parameter??????????????¢??????????????????????????????????????? */
  for(int parameter = 0; parameter < 26; ++parameter) {
    string str = _str;
    for(int i = 0; i < (int)str.length(); ++i) {
      
      /* ?°?????????¢??????????????????????????? */
      if(isSmallAlphabet(str[i])) {
        str[i] += parameter;
        /* ???????????????????°?????????§???????????£??????*/
        if(!isSmallAlphabet(str[i])) {
          str[i] -= 26;
        }
      }

    }

    /* Find "the" or "this" or "that" */
    if(isHit(str)) {
      cout << str << endl;
    }
  }
}

int main() {
  string str;
  while(getline(cin, str)) {
    CaesarCipher(str);
  }
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

// #define int long long

/* short */
#define pb push_back
#define print(Target) cout << Target << '\n'

/* REPmacro */
#define REP(i, n) for (int i = 0; i < (n); i++)
#define REPS(i, a, n) for (int i = (a); i < (n); i++)

/* typedef */
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vector<int> > vii;
typedef pair<int, int> pii;

/* func */
inline bool is_uruu(int y) {return (y % 4 == 0 && (y % 100 != 0 || y % 400 == 0));}

/* const */
const int INF = INT_MAX;

signed main()
{
  ios::sync_with_stdio(false);
  string s;

  while (getline(cin, s), s != ""){
    for (;s.find("the") == -1 && s.find("this") == -1 && s.find("that") == -1;){
      REP(i, s.size()){
        if ('a' <= s[i] && s[i] <= 'y'){
          s[i]++;
        } else if (s[i] == 'z'){
          s[i] = 'a';
        }
      }
    }
    print(s);
  }
  
  return (0);
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
using namespace std;
typedef pair<int,char*> str;

int main(void){
	char s[81];
	vector<str> v;
	const char* cmp1="that";
	const char* cmp2="this";
	const char* cmp3="the";
	bool is_found=false;
	int pos=0,end_pos,diff;
	char c;

	scanf("%[^\n]",s);
	for(int i=0;i<81;i++){
		if(s[i]==' ' || s[i]=='.'){
			c=s[i];
			s[i]='\0';
			v.push_back(str(i-pos,s+pos));
			s[i]=c;
			pos=i+1;
		}else if(s[i]=='\0'){
			end_pos=i;
			break;
		}
	}

	for(int i=0;i<v.size();i++){
		is_found=false;

		diff=1000;
		if(v[i].first==4){
			for(int j=0;j<4;j++){
				if(diff==1000){
					diff=v[i].second[j]-cmp1[j];
				}else if(diff!=v[i].second[j]-cmp1[j]){
					is_found=true;
					break;
				}
			}

			if(!is_found) break;

			diff=1000;
			for(int j=0;j<4 && !is_found;j++){
				if(diff==1000){
					diff=v[i].second[j]-cmp2[j];
				}else if(diff!=v[i].second[j]-cmp2[j]){
					is_found=true;
					break;
				}
			}

			if(!is_found) break;
		}else if(v[i].first==3){
			diff=1000;
			for(int j=0;j<3;j++){
				if(diff==1000){
					diff=v[i].second[j]-cmp2[j];
				}else if(diff!=v[i].second[j]-cmp2[j]){
					is_found=true;
					break;
				}
			}
			if(!is_found) break;
		}
	}
	
	for(int i=0;i<end_pos;i++){
		if(s[i]!=' ' && s[i]!='.'){
			s[i]-=diff;
		}
	}

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


	return 0;
}

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

char buf[1000];
string enc, ans;

string decrypt(string s, int k) {
  string ret = "";
  for (int i=0; i<s.size(); i++) {
    char c = s[i];
    if ('a' <= c && c <= 'z') {
      ret += ('a' + ((c-'a')+k)%26);
    } else {
      ret += c;
    }
  }
  return ret;
}

int main() {
  while (1) {
    if (fgets(buf, 100, stdin) == NULL) break;
    enc = buf;
    for (int i=0;i<26;i++) {
      ans = decrypt(enc, i);
      if (ans.find("the") != string::npos) break;
      if (ans.find("this") != string::npos) break;
      if (ans.find("that") != string::npos) break;
    }

    printf("%s", ans.c_str());
  }
}

C++: #include<iostream>
#include<cstring>
#include<stdio.h>
using namespace std;

int main(){
  char a[100],b[100];
  for(int i;i<100;i++){
    a[i]='\0';
    b[i]='\0';
  }
  gets(a);
  int i=0;
  while(i<26){
    for(int j=0;!(a[j]=='\0');j++){
      if(0x61<=a[j]+i&&a[j]+i<=0x7A)
	b[j]+=i;
      else if(0x61<=a[j]&&a[j]<=0x7A){
	b[j]=a[j]-26+i;
      }
      else if(a[j]==' ')
	b[j]=' ';
      else if(a[j]=='.')
	b[j]='.';
      
    }
    if(strstr(b,"the")||strstr(b,"this")||strstr(b,"that"))
      break;
    i++;
  }
  for(int k=0;a[k]!='\0';k++)
    cout<<b[k];
  cout<<'\n';
  return 0;
}

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

using namespace std;

int main()
{
	string str;
	
	while (getline(std::cin, str), !str.empty()){
		int j = 0;
		int di = 0;
		bool flag = false;
		for (int i = 0; i < str.size(); i++){
			if (str[i] == ' '){
				if (i - j < 5 && i - j > 1){
					if (str[j] - str[j + 1] == 12){
						if (str[j + 1] - str[j + 2] == 3){
							di = str[j] - 't';
							flag = true;
							break;
						}
						else if (str[j + 1] - str[j + 2] == -1){
							if (str[j + 2] - str[j + 3] == -10){
								di = str[j] - 't';
								flag = true;
								break;
							}
						}
						else if (str[j + 1] - str[j + 2] == 7){
							if (str[j + 2] - str[j + 3] == -19){
								di = str[j] - 't';
								flag = true;
								break;
							}
						}
					}
					
				j = i + 1;
				}
			}
		}
		
		for (int i = 0; i < str.size();i++){
			if ('a' <= str[i] && str[i] <= 'z'){		
				str[i] = str[i] - di;
			}
		}
		if (flag){
			cout << str << endl;
		}
	}
}