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;

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;
}

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

using namespace std;

char data[26]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
char trans[100];
char mozi;
int position=0;
int zoom;
int first_check=0,first_position=0;
int now;
char result;
int flag = 0;

int main(){
	while(flag == 0){
		scanf("%c",&mozi);
		if(first_check == 0)

		for(int i=0;i<26 && first_check == 0;i++){
			if(mozi == data[i]){
				first_position = i;
				zoom = first_position - 19;
				first_check = 1;
				break;
			}
		}




		if(mozi == ' ' || mozi == '.' || mozi == '\n'){
			if(mozi == ' ' || mozi == '.'){
				trans[position] = mozi;
				position++;
			}

			if(mozi == '\n'){
				trans[position] = '\n';
				cout << trans << endl;
				first_check = 0;
				position = 0;
				memset(trans,'\0',sizeof(trans));
				flag = 1;
			}
		}else{
			for(int i=0;i<26;i++){
				if(data[i] == mozi){
					now = i;
					break;
				}
			}

			trans[position] = data[now - zoom];
			position++;

		}
	}
}

C++: #include <iostream>
#include <string>
int main(int argc, const char * argv[])
{
    using namespace std;
    string word;
    int i;
    while (getline(cin, word)) {
        for (i = 0; i < word.length(); i++) {
            if (isalpha(word[i])) {
                word[i] -= 4;
            }
        }
        cout << word << endl;
    }
    return 0;
}