Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

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 {
		infos := strings.Split(nextString(), " ")
		plain := make([]string, len(infos))
		if reflect.DeepEqual(infos, []string{}) {
			break
		}
		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 <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>

using namespace std;
typedef long long ll;

int main(){
    int in;
    char S[1000];
    
    gets(S);
    
    while(1){
        
        bool f = false;
        
        for(int i=0;S[i]!='\0';i++){
            if('a'<=S[i] && S[i]<='y'){
                S[i]++;
            }else if(S[i]=='z'){
                S[i]='a';
            }
            
            if(i>=2){
                if(S[i-2]=='t' && S[i-1]=='h' && S[i]=='e')
                    f=true;
            }
            if(i>=3){
                if(S[i-3]=='t' && S[i-2]=='h')
                    if((S[i-1]=='i' && S[i]=='s') || (S[i-1]=='a' && S[i]=='t'))
                        f=true;
            }
        }
        
        if(f) break;
    }
    
    printf("%s\n",S);
    
    return 0;
}

C++: #include<iostream>
#include<cstring>
#define MAX 90
using namespace std;
char str[MAX];
bool contain(){
	for(int i=0;str[i]!='\0';i++){
		if(str[i]=='t'){
			if(strncmp(&str[i],"the",3)==0)
			return 1;
			else if(strncmp(&str[i],"this",4)==0)
			return 1;
			else if(strncmp(&str[i],"that",4)==0)
			return 1;
		}
	}
	return 0;
}
void rotate(){
	for(int i=0;str[i]!='\0';i++)
	if(str[i]=='z')
	str[i]='a';
	else if(isalpha(str[i]))
	str[i]=(char)(str[i]+1);
}
int main(){
	while(cin.getline(str,MAX)){
		for(int i=0;i<26;i++){
			rotate();
			if(contain())
				break;
		}
		cout<<str<<endl;
	}
	return 0;
}

C++: 
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main(){
  string s;
  int pl=0;
  while(getline(cin,s)){
    if(s=="\n"&&s=="EOF")  break;
  for(int i =-30;i<30;i++){
    for(int j = 0; j < s.size(); j++){
      if(s[j]+i=='t' &&s[j+1]+i == 'h' && s[j+2]+i == 'e'){
	pl = i;
	break;
      }
      if(s[j]+i=='t' &&s[j+1]+i == 'h' && s[j+2]+i == 'a' && s[j+3]+i=='t'){
	pl = i;
	break;
      }
      if(s[j]+i=='t' &&s[j+1]+i == 'h' && s[j+2]+i == 'i' && s[j+3]+i=='s'){
	pl = i;
	break;
      }
    }
    if(pl!=0) break;
  }
  for(int i=0;i <s.size();i++){
    if(s[i]<='z' && s[i]>='a') s[i] += pl;
    if(s[i]!=' ' && s[i]!=',' && s[i]!='.'){
    	if(s[i]>'z') s[i]-=26;
    	else if(s[i]<'a') s[i]+=26;
    }
  } 
  cout<<s<<endl;
  pl=0;
  }
}

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

using namespace std;

void Shift(string *str, int shift, int vec) {
  for (int str_i = 0; str_i < str->size(); str_i++)
    if (!isspace((*str)[str_i]) && (*str)[str_i] != '.')
      (*str)[str_i] += vec * shift;
}

bool FindTarget(string str) {
  if (str.find("the") != string::npos ||
      str.find("this") != string::npos ||
      str.find("that") != string::npos)
    return true;
  else
    return false;
}

int main() { 
  string input_str;

  int shift = 1;
  while (getline(cin, input_str)) {
    while (1) {
      Shift(&input_str, shift, -1);
      if (FindTarget(input_str))
        break;
      Shift(&input_str, shift, 1);
      shift++;
    }
    cout << input_str << endl;
  }

  return 0;
}

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

using namespace std;

void solve()
{
	string str;
	while(getline(cin, str))
	{
		string word;
		int n = str.size();
		for(int j = 0; j < 26; ++j)
		{
			word.clear();
			for(int i = 0; i < n; ++i)
			{
				if('a' <= str[i] && str[i] <= 'z')
				{
					word += (str[i] + j -'a') % 26 + 'a';
				}
				else
				{
					word += str[i];
				}
			}
			if(word.find("this") != -1 || word.find("the") != -1 || word.find("that") != -1)
			{
				cout << word << endl;
			}
		}
	}
}

int main()
{
	solve();
	return(0);
}

C++: #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#include <ctype.h>

#define GETSTR(p)       fgets((p), sizeof(p), stdin)
#define CHOMP(p)        do{ char *_q = (p) + strlen(p)-1; if(*_q == '\n') *_q = 0;            } while(0)

int main(void){
    char buf[100];
    while(GETSTR(buf)){
        CHOMP(buf);
        int len = strlen(buf);

        const int nn = 'z' - 'a' + 1;

        while(1){
            for(int i = 0; i < len; i++){
                if(isalpha(buf[i])){
                    buf[i] = 'a' + (buf[i] - 'a' + nn + 1) % nn;
                }
            }
            char buf2[100];
            sprintf(buf2, " %s ", buf);
            int l = strlen(buf2);
            for(int i = 0; i < l; i++){
                if(! isalpha(buf2[i])) buf2[i] = ' ';
            }
            if(strstr(buf2, " the ") != NULL) break;
            if(strstr(buf2, " this ") != NULL) break;
            if(strstr(buf2, " that ") != NULL) break;
        }
        puts(buf);
    }

    return 0;
}

C++: #include <bits/stdc++.h>
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() - 1; ++j){
				if(s[j] == 'a')
					s[j] = 'z';
				else if(s[j] == ' ')
					continue;
				else
					s[j]--;
			}
			string t("");
			for(int j = 0; j < s.size() - 1; ++j){
				if(s[j] == ' '){
					if(t == "the" || t == "this" || t == "that"){
						cout << s << endl;
						goto end;
					}
					t = "";
				}
				else{
					t += s[j];
				}
			}
		}
		end:;
	}
	return 0;
}

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

char chshift(char ch){
  if(ch>='a' && ch<='z'){
    return (ch-'a'+1)%26+'a';
  }else{
    return ch;
  }
}

std::string strshift(std::string s){
  for(int i=0; i<s.length(); i++){
    s[i] = chshift(s[i]);
  }
  return s;
}

bool valid_text_p(std::string str){
  return str.find("the") != -1 && str.find("that") != -1 && str.find("this") != -1;
}

int main(){
  std::string s;
  while(std::getline(std::cin,s), !std::cin.eof()){
    for(;;s = strshift(s)){
      if(valid_text_p(s)){
	std::cout << s << std::endl;
	break;
      }
    }
  }
  return 0;
}