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;

string arrs[200];

bool judge4(const string &str) {
	int d1 = str[0] - 't';
	int d2 = str[1] - 'h';
	int d3 = str[2] - 'i';
	int d4 = str[3] - 's';
	int d5 = str[2] - 'a';
	int d6 = str[3] - 't';
	return (d1 == d2 && ((d2 == d3 && d3 == d4) || (d2 == d5 && d3 == d6)));
}

bool judge3(const string &str) {
	int d1 = str[0] - 't';
	int d2 = str[1] - 'h';
	int d3 = str[2] - 'e';
	return (d1 == d2 && d2 == d3);
}

int main() {
	cin.clear();
	int cnt = 0;
	while (!cin.eof()) {
		cin >> arrs[cnt++];
		char ch = getchar();
		if (ch == '\n') {
			bool isOk = 0;
			int delta = 0;
			for (int i = 0; i < cnt; ++i) {
				if (arrs[i].length() == 4) {
					if (judge4(arrs[i])) {
						isOk = 1;
						delta = arrs[i][0] - 't';
						break;
					}
				}else if (arrs[i].length() == 3) {
					if (judge3(arrs[i])) {
						isOk = 1;
						delta = arrs[i][0] - 't';
						break;
					}
				}
			}
			for (int i = 0; i < cnt; ++i) {
				for (int j = 0; j < arrs[i].length(); ++j) 
					if (arrs[i][j] != '.') arrs[i][j]-= delta;
				cout << arrs[i] << ((i == cnt - 1) ? "\n" : " ");
			}
			cnt = 0;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<string>
#define num 27
using namespace std;

int main(){
	int i;
	string str;
	getline(cin, str);
	string strcp = str;
	string::iterator si;
	for(i=0;i<num;i++){
		if(  strcp.find("this") != string::npos
		  || strcp.find("that") != string::npos
		  || strcp.find("the" ) != string::npos){
			cout << strcp << endl;
		}
		si = strcp.begin();
		while(si != strcp.end()){
			if('a' <= *si && *si <= 'y'){
				*si = *si + char(1);
			}else if(*si == 'z'){
				*si = 'a';
			}
			si++;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <regex>
using namespace std;

vector<string> v;

vector<string> split(string&& s, regex&& pattern) {
    sregex_token_iterator first(s.begin(), s.end(), pattern, -1);
    sregex_token_iterator last;
    return(vector<string>(first, last));
}

bool cheser() {
    for(int r = 1; r <= 50; r++) {
        bool found = false;
        for(int c = 0; c < v.size(); c++) {
            for(int k = 0; k < v[c].length(); k++) {
                if(!isalpha(v[c][k])) continue;
                int now = v[c][k] - 'a';
                now = (now+1)%26;
                v[c][k] = 'a' + now;
            }
            if(v[c] == "the" || v[c] == "this" || v[c] == "that") found = true;
        }
        if(found) return(true);
    }
    return(false);
}

int main(void) {
    string input;
    while(getline(cin, input)) {
        v = split(move(input), regex(" "));
        cheser();
        for(int r = 0; r < v.size(); r++) {
            cout << v[r];
            if(r == v.size() - 1) cout << endl;
            else                  cout << " ";
        }
    }
    
    return(0);
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
  int ans=-1,len=0;
  string s;
  while(getline(cin,s)){
    while(1){
      ans = s.find("the");
      if(ans!=-1)break;
      ans = s.find("this");
      if(ans!=-1)break;
      ans = s.find("that");
      if(ans!=-1)break;
      for(int i=0;i<s.size();i++){
	if(s[i]=='z') s[i]='a';
	else if(s[i]>='a' && s[i]<'z') s[i]++;
      }
    }
    cout << s << endl;
  }
}

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;
			c -= c > 'z' ? 'z'-'a'+1 : '\0';
		});
		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;
			c -= c > 'z' ? 'z'-'a'+1 : '\0';
		});
		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;
				c -= c > 'z' ? 'z'-'a'+1 : '\0';
			}
		});
		cout << s << endl;
	}
}

C++: #include <bits/stdc++.h>
 
using namespace std;
 
#define FOR(i, j, k) for(int i = j; i < k; ++i)
#define rep(i, j) FOR(i, 0, j)
#define repr(i, j) for(int i = j; i >= 0; --i)
#define INF (1 << 30)
#define MOD 1e9 + 7
 
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
 
int main() {
    string s;
    while(getline(cin, s)){
    	rep(i, 26) {
	    	rep(j, s.size()) {
	            if('a' <= s[j] && s[j] < 'z') s[j] = s[j] + 'a';
	            else if(s[j] == 'z') s[j] = 'a';
	        }
	        if(s.find("the") != string::npos || s.find("this") != string::npos || s.find("that") != string::npos){
                cout << s << endl;
            }
	    }
    }
    return 0;
}

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

bool dec(string str, string array[]) {
  for (int i = 0; i < 3; i++) {
    if (str.find(array[i], 0) != string::npos) return false;
  }
  return true;
}

int main() {
  string array[3] = {"the", "this", "that"};
  while (1) {
    string str;
    getline(cin, str);
    while (dec(str, array)) {
      for (int i = 0; str[i] != '\0'; i++) {
	if ('a' <= str[i] && str[i] <= 'z') {
	  if (str[i] == 'z') str[i] = 'a';
	  else str[i]++;
	}
      }      
    }
    cout << str << endl;
  }
  return 0;
}

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

int main(){
   string str;
   bool ans=false;
   getline(cin,str);
   
   string::iterator ite=str.begin();
   
   while(1){
      //cout << str.find("the");
      if(str.find("the")<str.size()) ans=true;
      else if(str.find("this")<str.size()) ans=true;
      else if(str.find("that")<str.size()) ans=true;
      if(ans) break;
      for(int i=0;i<str.size();i++){
         if(*(ite+i)!=' '&&*(ite+i)!='.') *(ite+i)-=1;
      }
   }
   cout << str << endl;
}