Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func incrementByte(b byte) byte {
	if b >= 97 && b < 122 {
		return b + 1
	} else if b == 122 {
		return 97
	}
	return b
}

func main() {
	scanner.Split(bufio.ScanLines)

	for {
		line := nextString()
		if len(line) == 0 {
			break
		}
		for i := 0; i <= 26; i++ {
			decoded := []byte{}
			for j := 0; j < len(line); j++ {
				decoded = append(decoded, incrementByte(line[j]))
			}
			line = string(decoded)
			if strings.Contains(line, "the") || strings.Contains(line, "this") || strings.Contains(line, "that") {
				fmt.Println(line)
				break
			}
		}
	}
}

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

int main(void)
{
	int i;
	int len;
	int f;
	int n;
	char str[128];
	
	while (fgets(str, 100, stdin) != NULL){
		f = 0;
		n = 0;
		while (n < 25){
			len = strlen(str);
			for (i = 0; i < len; i++){
				if (strncmp(&str[i], "the", 3) == 0){
					f = 1;
				}
				if (strncmp(&str[i], "this", 4) == 0){
					f = 1;
				}
				if (strncmp(&str[i], "that", 4) == 0){
					f = 1;
				}
			}
			if (f == 1){
				break;
			}
			for (i = 0; i < len; i++){
				if (str[i] >= 'a' && str[i] < 'z'){
					str[i]++;
				}
				if (str[i] == 'z'){
					str[i] = 'a';
				}
			}
			n++;
		}
		printf("%s", str);
	}
	return (0);
}

C++:  //include
 //------------------------------------------
 #include <vector>
 #include <list>
 #include <map>
 #include <set>
 #include <deque>
 #include <stack>
 #include <bitset>
 #include <algorithm>
 #include <functional>
 #include <numeric>
 #include <utility>
 #include <sstream>
 #include <iostream>
 #include <iomanip>
 #include <cstdio>
 #include <cmath>
 #include <cstdlib>
 #include <cctype>
 #include <string>
 #include <cstring>
 #include <ctime>

 using namespace std;

 //conversion
 //------------------------------------------
 inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
 template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

 //math
 //-------------------------------------------
 template<class T> inline T sqr(T x) {return x*x;}

 //typedef
 //------------------------------------------
 typedef vector<int> VI;
 typedef vector<VI> VVI;
 typedef vector<string> VS;
 typedef pair<int, int> PII;
 typedef long long LL;
 typedef unsigned long long ULL;

 //container util
 //------------------------------------------
 #define ALL(a)  (a).begin(),(a).end()
 #define RALL(a) (a).rbegin(), (a).rend()
 #define PB push_back
 #define MP make_pair
 #define SZ(a) int((a).size())
 #define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
 #define EXIST(s,e) ((s).find(e)!=(s).end())
 #define SORT(c) sort((c).begin(),(c).end())

 //repetition
 //------------------------------------------
 #define FOR(i,a,b) for(int i=(a);i<(b);++i)
 #define REP(i,n)  FOR(i,0,n)

 //constant
 //--------------------------------------------
 const double EPS = 1e-10;
 const double PI  = acos(-1.0);

 //clear memory
 #define CLR(a) memset((a), 0 ,sizeof(a))

 //debug
 #define dump(x)  cerr << #x << " = " << (x) << endl;
 #define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

 int main() {
   int n;
   string str;

   while(getline(cin, str)) {
     for(int i = 0; i < str.size(); i++) {
       for(int j = 0; str[i]+j <= 'z'; j++) {
	 if(str[i] + j == 't' && str[i+1] + j == 'h') {
	   n = j;
	   break;
	 }
       } 
       for(int j = 0; str[i]-j >= 'a'; j++) {
	 if(str[i] - j == 't' && str[i+1] - j == 'h') {
	   n = -j;
	 break;
	 }
       }
     }
     
     for(int i = 0; i < str.size(); i++) {
       if(str[i] == ' ' || str[i] == '.' || str[i] == '\n') printf("%c", str[i]);
       else printf("%c", str[i]+n);
     }
     cout << endl;
   }
 }

C++: #include <stdio.h>

int main(void)
{
	char str[100];
	int num;
	int i;
	
	while (fgets(str, 99, stdin) != EOF){
		num = 't' - str[0];
		i = 0;
		while (str[i] != '\0'){
			if ((str[i] >= 'A' && str[i] <= 'Z') || (str[i] >= 'a' && str[i] <= 'z')){
				str[i] += num;
			}
			i++;
		}
		printf("%s", str);
	}
	
	printf("\n");
	
	return (0);
}

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

int main(){
  string s;

  getline( cin,s );
  for( int i=0;i<26;i++ ){
    for( unsigned int j=0;j<s.length();j++ ){
      if( s[j]<'a' || s[j]>'z' ) continue;
      if( ++s[j]>'z' ) s[j] = 'a';
    }

    //    cout << "in loop : " << s << endl;
    int s1 = s.find("the");
    int s2 = s.find("this");
    int s3 = s.find("that");
    //    cout << s1 << "," << s2 << "," << s3 << endl;

    if( s1>=0 || s2>=0 || s3>=0 )
      break;
  }
  cout << s << endl;

  return 0;
}

C++: #include<iostream>
#include<string>
#include<cstdio>
int main(){std::string s;while(std::getline(std::cin,s)){char b[81],*p,*c;c=b;strcpy(b,s.c_str());int gap=0;do{p=strtok(c," .\n");if(p!=NULL){int l=strlen(p);if(l>=3&&p[0]-p[1]=='t'-'h'){if(l==3){if(p[0]-p[2]=='t'-'e'){gap='t'-p[0];break;}}else if(l==4){if(p[0]-p[2]=='t'-'i'&&p[0]-p[3]=='t'-'s'){gap='t'-p[0];break;}else if(p[0]-p[2]=='t'-'a'&&p[0]-p[3]==0){gap='t'-p[0];break;}}}}c=NULL;}while(p!=NULL);for(std::string::iterator it=s.begin();it!=s.end();++it){if(*it!=' '&&*it!='.'&&*it!='\n'){std::cout<<static_cast<char>(*it+gap);}else{std::cout<<*it;}}}}

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

std::string decrypto(std::string str) {
    using namespace std;
    regex pattern("(.*)(the|this|that)(.*)");
    for (int c = 0; c < 'z' - 'a' + 1; ++c) {
        for (size_t i = 0; i < str.size(); ++i) {
            if ('a' <= str[i] && str[i] <= 'z') {
                if (str[i] == 'z') {
                    str[i] = 'a';
                } else {
                    str[i] += 1;
                }
            }
        }
        if (regex_match(str, pattern)) {
            return str;
        }
    }
    return string("");
}

int main() {
    std::string str;
    while (std::getline(std::cin, str)) {
        std::cout << decrypto(str) << std::endl;
    }
}

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

int main() {
  string s;
  getline(cin, s);

  bool b = false;
  for(int i = 1; i < 26; i++) {
    string change;
    for(int j = 0; j < s.size(); j++) {
      if('a' <= s[j] && s[j] <= 'z') change += (s[j]+i)%26 + 'a';
      else change += s[j];
    }

    for(int j = 0; j < change.size(); j++) {
      string tmp = change.substr(j,4);
      if(tmp == "this" || tmp == "that" || tmp.substr(0,3) == "the") b = true;
    }
    if(b) {
      cout << change << endl;
      break;
    }
  }
}

C++: #include <iostream>
#include <iomanip>
#include <list>
#include <map>
#include <algorithm>
#include <stack>
#include <string>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>

using namespace std;


int main(){
	string tmp;
	string key[] = {"the","this","that"};
	int alfabet;
	bool clearFlag;
	while(getline(cin,tmp)){
		clearFlag = false;
		alfabet = 26;
		while(alfabet--){

			for(string::iterator it = tmp.begin(); it != tmp.end(); it++){
				if(*it >= 'a' && *it <= 'z'){
					(*it)++;
					if(*it >= 'z'){
						*it = 'a';
					}
				}
			}
			for(int j = 0; j < 3; j++){
				if(tmp.find(key[j]) != string::npos){
					cout << tmp << endl;
					clearFlag = true;
					break;
				}
			}

			if(clearFlag == true){
				break;
			}

		}

	}
	return 0;
}