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++: /*0017 written by iPhone*/
#include <iostream>
#include <string>

using namespace std;

int main(){
    string s;
    while(getline(cin, s) && s != "\0"){
        for(int i = 0; i < s.size(); i++) {
            if(s[i] != ' ') s[i]++;
            if(s[i] > 'z' && s[i] != ' ') s[i] -= 26;
        }
        if(s.find("the") != -1 || s.find("this") != -1 || s.find("that") != -1 ){
            cout << s;
            return 0;
        }
    }
    return 0;
}

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


std::vector<std::string> split(const std::string &s, char delim) {
	std::vector<std::string> elems;
	std::stringstream ss(s);
	std::string item;
	while (std::getline(ss, item, delim)) {
		if (!item.empty()) {
			elems.push_back(item);
		}
	}
	return elems;
}

int main() {
	std::string input;
	while (std::getline(std::cin, input)) {
		std::vector<std::string> words;
		bool isPeriod = false, isCipher = false;
		if (*(input.rbegin()) == '.') {
			input.erase(input.end() - 1);
			isPeriod = true;
		}
		words = split(input, ' ');
		for (int i = 0; i < 26; i++) {
			for (std::vector<std::string>::iterator itr = words.begin(); itr != words.end(); itr++) {
				for (std::string::iterator sitr = (*itr).begin(); sitr != (*itr).end(); sitr++) {
					*sitr = ((*sitr - 'a' + 1) % 26) + 'a';
				}
				if (*itr == "the" || *itr == "this" || *itr == "that") {
					isCipher = true;
				}
			}
			if (isCipher) break;
		}
		std::string output = "";
		for (std::vector<std::string>::iterator itr = words.begin(); itr != words.end(); itr++) {
			if (output != "") output += " ";
			output += *itr;
		}
		if (isPeriod) output += ".";
		std::cout << output << std::endl;
	}
	return 0;
}

C++: #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>

using namespace std;

typedef long long Int;
typedef vector<int> vint;
typedef pair<int,int> pint;
#define mp make_pair

template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }
int in() { int x; scanf("%d", &x); return x; }

int main() {
	string str;
	for(;getline(cin,str)&eofbit;){
		int len=str.size();
		int i,c;
		for(c=1;c<=26;c++){
			for(i=0;i<len;i++){
				if('a'<=str[i]&&str[i]<='z'){
					str[i]++;
					if(str[i]>'z')str[i]='a';
				}
			}
			//cout<<str<<endl;
			if(str.find("the")!=string::npos||str.find("this")!=string::npos||str.find("that")!=string::npos){
				cout<<str<<endl;
				break;
			}
		}
	}
	return 0;
}

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