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 <algorithm>
#include<string>
#include<vector>
int main() {
	std::string s,a;
	std::getline (std::cin , s);
	int p = s[0] - 't';
	for (int i = 0; i < s.size(); ++i) {
		if (s[i] != ' ' &&s[i]!= '.') {
			if (s[i] - p < 'a') {
				a += 'z' - ('a' - (s[i] - p)-1);
			}
			else a += s[i] - p;
		}
		else a += s[i];
	}
	std::cout << a<< std::endl;
	return 0;
}

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

int cmp(string s){
	if(s.find("that",0)!=string::npos) return 1;
	if(s.find("the",0)!=string::npos) return 1;
	if(s.find("this",0)!=string::npos) return 1;
	return 0;
}

int main() {
	string s;
	getline(cin,s);
	for(int h=0;h<26;h++){
		for(unsigned int i=0;i<s.length();i++){
				if(s[i]==0x2e||s[i]==0x20||s[i]==0x0a) continue;
				s[i]+=1;
				if((int)s[i]>0x7a) s[i]=0x61;
		}if(cmp(s)==1) break;
	} cout<<s<<endl;
	return 0;
}

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

using namespace std;

int main()
{
  string stro, str;
  while(getline(cin, stro)){
    for(int i = 0; i < 26; i++){
      str = stro;
      for(int j = 0; j < stro.length(); j++){
	if(str[j] >= 'a' && str[j] <= 'z')
	  if(str[j] + i > 'z')
	    str[j] += i - 26;
	  else
	    str[j] += i;
      }
      unsigned f_the = str.find("the", 0);
      unsigned f_this = str.find("this", 0);
      unsigned f_that = str.find("that", 0);
      if((f_the != string::npos && f_the == 0 && (str[f_the + 3] == ' ' || str[f_the + 3] == '.' || str[f_the + 3] == '\0')) || (f_this != string::npos && f_this == 0 && (str[f_this + 4] == ' ' || str[f_this + 4] == '.' || str[f_this + 4] == '\0')) || (f_that != string::npos && f_that == 0 && (str[f_that + 4] == ' ' || str[f_that + 4] == '.' || str[f_that + 4] == '\0')))
	cout << str << endl;
      else if((f_the != string::npos && (str[f_the - 1] == ' ' || str[f_the - 1] == '.' || str[f_the - 1] == '\n') && (str[f_the + 3] == ' ' || str[f_the + 3] == '.' || str[f_the + 3] == '\0')) || (f_this != string::npos && (str[f_this - 1] == ' ' || str[f_this - 1] == '.' || str[f_this - 1] == '\n') && (str[f_this + 4] == ' ' || str[f_this + 4] == '.' || str[f_this + 4] == '\0')) || (f_that != string::npos && (str[f_that - 1] == ' ' || str[f_that - 1] == '.' || str[f_that - 1] == '\n') && (str[f_that + 4] == ' ' || str[f_that + 4] == '.' || str[f_that + 4] == '\0')))
	cout << str << endl;	 
    }
  }
}

C++: #include <iostream>
#include <string>
using namespace std;
int caesar(char s[]);
bool search(string s);

int main(){
	string str;
	unsigned int i;
	while(getline(cin,str)){
		int j=0;
		while(!search(str)){
			for(i=0;i<str.length();i++){
				if(str[i]!=' '&&str[i]!='.') str[i]++;
				if(str[i]>122) str[i]=97;
			}
			j++;
			if(j>25) break;
		}
		cout << str << endl;
	}
	return 0;
}

bool search(string s){
	if(s.find("this")!=string::npos) return true;
	if(s.find("that")!=string::npos) return true;
	if(s.find("the")!=string::npos) return true;
	return false;
}

C++: #include <string>
#include <vector>
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <map>
#define INF 100000000
#define rep(i,a) for(int i=0;i<(a);i++)

using namespace std;
typedef long long ll;

char p(char ch){
    char ret=ch+1;
    if(ret==('{'))ret='a';
    return ret;
}


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


    rep(i,26){
        rep(j,s.size()){
            if(s[j]!=' ' && s[j]!='.'){
                s[j]=p(s[j]);
            }
        }

        if( s.find("the",0)!=-1 || s.find("this",0)!=-1 || s.find("that",0)!=-1 ){
            cout<<s<<endl;
        }
    }
    
    return 0;
    
}

C++: #include<iostream>
#include<cstdio>
#include<cmath>
#include<vector>
#include<list>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<string>
#include<utility>
#include<algorithm>
#include<functional>
#include<deque>
#include<string.h>
#include<ctype.h>
#include<time.h>
#include<stdlib.h>
using namespace std;

char a[85];

bool search_th(){
  for (int i = 0; i < strlen(a); i++){
    if (a[i] == 't' && a[i+1] == 'h'){
      if (a[i+2] == 'e' || (a[i+2] == 'i' && a[i+3] == 's') || (a[i+2] == 'a' && a[i+3] == 't')){
        return true;
      }
    } else {
      i += 2;
    }
  }
  return false;
}

int main(){
  while (cin.getline(a, sizeof(a))){
    for (int i = strlen(a); i < 85; i++){
      a[i] = '\0';
    }
    while (1){
      if (search_th() == true){
        cout << a << endl;  break;
      }
      for (int j = 0; j < strlen(a); j++){
        if (a[j] >= 'a' && a[j] <= 'y') a[j]++;
        if (a[j] == 'z')                a[j] = 'a';
      }
      cout << a << endl;
    }
  }
  return 0;
}

C++: #include<cstdio>
#include<iostream>
#include<string>
#include<cctype>
using namespace std;
string cea (string a){
  for(int i=0;i<a.length();i++){
    if(isalpha(a[i])) a[i]=(char)a[i]+1;
    if(a[i]=='{')a[i]='a';
  }
    return a;
}

string cear(string b,int c){
  for(int i=0;i<c;i++){
    b=cea(b);
  }
  return b;
}


int main(){
  string input[100];
  string in;
  int n=0;
  int ans=0;
  while(cin>>in){
    if(in=="00")break;
    input[n]=in;
    n++;
    
  }
  for(int i=0;i<30;i++){
    for(int j=0;j<n;j++){
      in=cear(input[j],i);
      if(in=="the"||in=="this"||in=="that"){ans=i;}
    }
  }
  for(int i=0;i<n-1;i++){
    cout<<cear(input[i],ans)<<' ';
  }
  cout<<cear(input[n-1],ans)<<endl;
  //  cout<<ans<<endl;

}

C++: #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <functional>
#include <sstream>
using namespace std;
int main(){
	string buf;
	
	while(getline( cin,buf )){
	
		for(int i=0;i<30;++i){
			string tmp = buf;
			for(int j=0;j<tmp.size();++j){
				if( tmp[j] >= 'a' && tmp[j] <= 'z' ){
					int aaa = (int)tmp[j] + i;
					if( aaa > 'z' ){
						int diff = aaa -1 - 'z' ;
						tmp[j] = 'a' + diff;
					}else{
						tmp[j] = aaa;
					}
				}
			}
			if( tmp.find("the")!=string::npos || tmp.find("this")!=string::npos ||tmp.find("that")!=string::npos ){
				cout << tmp << endl;
				break;
			}
			//cout << i << " " << tmp << endl;
		}
	}
	return 0;
}