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(int argc, char *argv[]) {
  string str, copy;
  int shif;
  getline(cin, str);

  copy = str;
  shif = 1;
  while (true) {
    if (str.find(" this ") != string::npos ||
        str.find(" that ") != string::npos ||
        str.find(" the ") != string::npos)
      break;
    else
      for (string::iterator itr = str.begin();
           itr != str.end();
           itr++)
        if ('a' <= *itr && *itr <= 'z') {
          *itr += shif;
        } else if (*itr != '.' && *itr != ' ' &&
                   *itr != '\n') {
          str = copy;
          shif = -1;
          break;
        }
  }


  cout << str << endl;
  return 0;
}

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

int main(){

	string code;
	string word;
	bool found;

	while( getline(cin, code) ){
		found = false;

		for( int j=0;j<25;j++ ){


			for( int i=0;i<code.length();i++ ){
				if( code[i] >= 'a' && code[i] <= 'z' ){
					code[i] += 1;
					if(code[i]=='z'+1)code[i]='a';
				}
			}


			word = "";
			for( int i=0;i<code.length()+1;i++){
				if(code[i] >= 'a' && code[i] <= 'z' )
					word += code[i];
				else{
					if( word == "the" || word == "this" || word == "that" ){
						found = true;
					}
					word = "";
				}
				
			}
			if(found)break;
			
			
		cout << code << endl;
		
		}

	}
	return 0;

}

C++: import sys

def ceaser_decode(text):
    d={}
    line=""
    for n in range(26):
        for c in (65,97):
            for i in range(26):
                d[chr(i+c)] = chr((i+n)%26+c)

        line = "".join([d.get(c,c) for c in text])
        if line.find("the")!=-1 or line.find("this")!=-1 or line.find("that")!=-1:
            break
    return line

for i in sys.stdin.readlines():
    print ceaser_decode(i),

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

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

int main(){
	int i;
	string str;
	string strcp;
	string::iterator si;
	while(getline(cin, str)){
		strcp = str;
		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 + 1;
				}else if(*si == 'z'){
					*si = 'a';
				}
				si++;
			}
		}
	}
	return 0;
}

C++: #include<stdio.h>
#include<iostream>
#include<math.h>
#include<string>
using namespace std;
int main(){
	
	char s[100];
	while(cin.getline(s,100)){
		for(int i=0;s[i+1]!='\0';i++){
			if((s[i]-s[i+1]=='t'-'h')&&(((s[i+1]-s[i+2]=='h'-'i')&&(s[i+2]-s[i+3]=='i'-'s'))||(s[i+1]-s[i+2]=='h'-'e')||((s[i+1]-s[i+2]=='h'-'a')&&(s[i+2]-s[i+3]=='a'-'t')))){
				for(int j=0;s[j]!='\0';j++){
					if((s[j]!=' ')&&(s[j]!='.')){
						putchar((s[j]+'t'-s[i]-'a')%26+'a');
					}else{
						putchar(s[j]);
					}
				}cout<<endl;
			}
		}
	}
}

C++: #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int caesar(char s[]);
bool search(char s[]);

int main(){
	char s[256];
	int i,j=0,n=10;
	//while(scanf("%[^\n]",&s)!=EOF){
		while(!search(s)){
			for(i=0;s[i]!='.';i++){
				if(s[i]!=' ') s[i]++;
				if(s[i]>122) s[i]=97;
			}
		}
		printf("%s\n",s);
	//}
	return 0;
}

bool search(char s[]){
	char *is,*e,*at;
	int i=0;
	char *tmp;
	is="this";e="the";at="that";
	while(s[i]!='.'){
		if(s[i]=='t'&&s[i+1]=='h'){
				if(s[i+2]=='e') return true;
				else if(s[i+2]=='i'&&s[i+3]=='s') return true;
				else if(s[i+2]=='a'&&s[i+3]=='t') return true;
		}
		i++;
	}
	return false;
}

C++: #include<iostream>
using namespace std;
int main()
{
	char key[80] = "";
	
	cin.getline(key, sizeof(key));

		for (int i = 0; i < sizeof(key); i++)
		{
			//if (key[i] == (int)" ")cout << "space";
			if ((int)key[i] == 0)break;
			if ((int)key[i] <= 122 && (int)key[i] >= 97)
				key[i] = (int)key[i] - 1;
			if (key[i] == 96)key[i] = 122;
		}
		for (int i = 0; i < sizeof(key); i++)
		{
			if ((int)key[i] == 0)break;
			cout << key[i];
		}
	
	return 0;
}

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

int main(void){
	char data[100];
	char s1[]="the",
		 s2[]="this",
		 s3[]="that";
	int i,cnt=0;
	char *p;

	while(1){
		fgets(data,100,stdin);
		if(data[0]=='\n')
				break;
		while(cnt<=26){
			p=strstr(data,s1);
			if(p)
				break;
			p=strstr(data,s2);
			if(p)
				break;
			p=strstr(data,s3);
			if(p)
				break;
			for(i=0;i<100;i++){
				if(data[i]=='\0')
					break;
				if('a'<=data[i] && data[i]<='y')
					data[i]++;
				if('z'==data[i])
					data[i]='a';
			}
			cnt++;
		}
		cnt=0;
		printf("%s\n",data);
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
string word[3] = {"this","that","the"};
int main(){
  char c;
  string s[80];
  int smax = 0;
  while(scanf("%c",&c) != EOF){
    if(c == '\n' || c == ' '){
      smax++;s[smax] += c;
      smax++;
    }else{
      s[smax] += c;
    }
  }smax++;
  bool flag = false;
  while(1){
    for(int i = 0;i < smax;i++){
      for(int j = 0;j < s[i].size();j++){
	if(isalpha(s[i][j])){
	  s[i][j]++;
	  if(s[i][j] == 'z' + 1)s[i][j] = 'a';
	}
	for(int j = 0;j < 3;j++){
	  if(word[j] == s[i]){flag = true;break;}
	}for(int j = 0;j < 3;j++){
	  if(word[j] + '.' == s[i]){flag = true;break;}
	}
      }
    }
    if(flag)break;
  }
  for(int i = 0;i < smax;i++)cout << s[i];
  return 0;
}

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

int main(){
  char cip[80][80];
  int words;
  int i, j;
  int gap;

  words=0;
  while(cin>>cip[words]) words++;

  for(i=0; i<words; i++){
    for(j=0; j<strlen(cip[i]); j++){
      if(cip[i][j]=='.') continue;
      cip[i][j]-='a';
    }
    if(strlen(cip[i])==3
       && (cip[i][1]-cip[i][0]+26)%26==14
       && (cip[i][2]-cip[i][0]+26)%26==11){
      gap=(cip[i][0]-('t'-'a')+26)%26;
      continue;
    }
    if(strlen(cip[i])>3
       && (cip[i][1]-cip[i][0]+26)%26==14
       && (cip[i][2]-cip[i][0]+26)%26==15
       && (cip[i][3]-cip[i][0]+26)%26==25){
      gap=(cip[i][0]-('t'-'a')+26)%26;
      continue;
    }
    if(strlen(cip[i])>3
       && (cip[i][1]-cip[i][0]+26)%26==14
       && (cip[i][2]-cip[i][0]+26)%26==7
       && (cip[i][3]-cip[i][0]+26)%26==0){
      gap=(cip[i][0]-('t'-'a')+26)%26;
      continue;
    }
  }
  for(i=0; i<words; i++){
    for(j=0; j<strlen(cip[i]); j++){
      if(cip[i][j]=='.') continue;
      cip[i][j]=(cip[i][j]-gap+26)%26+'a';
    }
    if(i==words-1) printf("%s\n", cip[i]);
    else printf("%s ", cip[i]);
  }

  return 0;
}