Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func cipher(text string, direction int, int_shift int) string {
	shift, offset := rune(int_shift), rune(26)
	runes := []rune(text)
	for index, char := range runes {
		switch direction {
		case 1:
			if char >= 'a' && char <= 'z'-shift || char >= 'A' && char <= 'Z'-shift {
				char = char + shift
			} else if char > 'z'-shift && char <= 'z' || char > 'Z'-shift && char <= 'Z' {
				char = char + shift - offset
			}
		case -1:
			if char >= 'a'+shift && char <= 'z' || char >= 'A'+shift && char <= 'Z' {
				char = char - shift
			} else if char >= 'a' && char < 'a'+shift || char >= 'A' && char < 'A'+shift {
				char = char - shift + offset
			}
		}
		runes[index] = char
	}
	return string(runes)
}

func main() {
	for scanner.Scan() {
		infos := strings.Split(scanner.Text(), " ")
		plain := make([]string, len(infos))
		// fmt.Println(infos)
		Decryption:
			for i := 0; i < 26; i++ {
				for j := range infos {
					plain[j] = cipher(infos[j], 1, i)
				}
				for j := range plain {
					if plain[j] == "this" || plain[j] == "that" || plain[j] == "the" {
						break Decryption
					}
				}
			}
			fmt.Println(strings.Join(plain, " "))
	}
}

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

using namespace std;

int main()
{
  char s[81];

  while(gets(s) != NULL){

    int len = strlen(s);
    
    if(strstr(s,"this") || strstr(s,"that") || strstr(s,"the")){
      cout << s << endl;
      continue;
    }
    
    for(int i = 0;i < 'z' - 'a';i++){
      for(int j = 0;j < len;j++){
	if(s[j] >= 'a' && s[j] <= 'z'){
	  if(s[j]+1 > 'z'){
	    s[j] = 'a';
	  }
	  else{
	    s[j]++; 
	  }
	}
      }
      if(strstr(s,"this") || strstr(s,"that") || strstr(s,"the")){
	cout << s << endl;
	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;
    }
  }
}