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 <stdio.h>

int main(void)
{
	char str[80];
	int num, num2;
	int i;
	
	while (fgets(str, 80, stdin) != NULL){
		num = 't' - str[0];
		i = 0;
		while (str[i] != '\0'){
			if (str[i] != '.' && str[i] != ' ' && str[i] != '\n'){
				str[i] += num;
				if (str[i] > 'z'){
					num2 = str[i] - 'z';
					str[i] = num2 + 'a' - 1;
				}
				else if (str[i] < 'a'){
					num2 = 'a' - str[i] - 204;
					str[i] = 'z' - num2 + 1;
				}
			}
			i++;
		}
		printf("%s", str);
	}
	
	printf("\n");
	
	return (0);
}

C++: #include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <cstring>
using namespace std;
typedef long long int ll;
const int INF = 1000000000;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
int main(){
    string s;
    while(getline(cin, s)){
        rep(i, 26){
            for(char& c : s){
                if(isalpha(c)){
                    if(c != 'z') ++c;else c = 'a';
                }
            }
            if(s.find("that") != string::npos || s.find("this") != string::npos || s.find("the") != string::npos){
                cout << s << endl;
                return 0;
            }
        }
    }
}

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


int checkCaesarChipher(string str1, string str2){
	int a[1000],b[1000];
	bool flag = false;
	
	for(unsigned int i=0 ; i<str1.size()-1 ; i++){
		a[i] = (str1[0] - str1[i] + 26 - 'a') % 26;
		b[i] = (str2[0] - str2[i] + 26 - 'a') % 26;
		if(a[i]==b[i]){
			flag = true;
		}else{
			flag = false;
			break;
		}
	}
	if(flag){
		return (str2[0] - str1[0]);
	}else{
		return 0;
	}
}


int main(){
	string str, hoge, key;
	char s[80];
	int j=0, ans=0;
	
	while( getline(cin,str) ){
		for(int i=0 ; i<str.size() ; ++i){
			ans = 0;
			if( str[i] == ' ' || i==str.size()-1){
				if(i==str.size()-1){
					hoge = str.substr(j,i-j+1);
				}else{
					hoge = str.substr(j,i-j);
				}
				j = i+1;
				
				if(hoge.size()==3){
					key = "the";
					if(checkCaesarChipher( key , hoge )!=0){
						ans = checkCaesarChipher( key , hoge );
						break;
					}
				}
				if(hoge.size()==4){
					key = "that";
					if(checkCaesarChipher( key , hoge )!=0){
						ans = checkCaesarChipher( key , hoge );
						break;
					}
					key = "this";
					if(checkCaesarChipher( key , hoge )!=0){
						ans = checkCaesarChipher( key , hoge );
						break;
					}
				}
			}
		}
		if(ans!=0){
			for(int i=0 ; i<str.size() ; i++){
				if(str[i]>='a' && str[i]<='z'){
					str.at(i) -= ans;
				}
			}
			cout << str << endl;
		}
	}
	return 0;
}

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

int main() {
	string from;
	while (getline(cin,from)) {
		for (int j = 1; j <= 25; j++) {
			for (int i = 0; i < from.size(); i++) {
				if (from[i] != ','&&from[i] != '.'&&from[i] != ' ') {
					if (from[i] + 1 > 122)from[i] = from[i] + 1 - 26;
					else from[i] = from[i] + 1;
				}
			}
				if ((int)from.find("the") != -1)break;
				if ((int)from.find("this") != -1)break;
				if ((int)from.find("that") != -1)break;
		}
		cout << from << endl;
	}
	return 0;
}

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

string str;
char change(int i,int dl)
{
	char c = static_cast<char>(static_cast<int>(str[i])-dl);
	if(c<'a')
		c+=26;
	else if(c>'z')
		c-=26;
	return c;
}


int main()
{
	while(getline(cin,str)){
		int l,m;
		l = static_cast<int>(str[0] - 't');
		m = static_cast<int>(str[1] - 'h');
		char a = change(2,l);
		char b = change(3,l);
		if(l == m && ( a=='e' || (a=='i'&&b=='s') || (a=='a'&& b=='t'))){
			for(unsigned i=0;i<str.size();i++){
				if(islower(str[i])){
					cout << change(i,l);
				}else{
					cout << str[i];
				}
			}
			cout << endl;
		}
	}
	return 0;
}

C++:  
  #include<iostream>
 #include<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 #include<stack>
 
 using namespace std;
  
 int main()
 {
   string a,b;
   while(cin>>a)
   {
     for(int shift=1;shift<26;shift++)
     {
       for(int i=0;i<a.length();i++)
       {
         if(a[i]>='a'&&a[i]<='z')
         { 
           if(a[i]+shift>'z') b+=(a[i]+shift-26);
           else b+=(a[i]+shift)
         }         
         else b+=a[i]; 
       }
       if(a.find(the)||a.find(this)||a.find(that)) break;
       else continue;
     }             
     for(int i=0;i<b.length();i++)
     {
       if(i>=80&&i%80==0) cout<<endl;
       cout<<b[i]<<endl;        
     }
   }
   //while(1);      
   return 0;    
 }

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

using namespace std;

int main(){
	char ciph[81];

	while(cin.getline(ciph,81)){
		int len=strlen(ciph);
		int shift=0;
		for(int j=0;j<len-2;j++){
			if(ciph[j+1]-ciph[j+0]=='h'-'t'
			&& ciph[j+2]-ciph[j+1]=='e'-'h'
			&& !islower(ciph[j+3])
			&& (j==0 || !islower(ciph[j-1]))){
				shift=ciph[j]-'t';
				if(shift<0)	shift+=26;
				break;
			}
		}
		for(int j=0;j<len-3;j++){
			if(ciph[j+1]-ciph[j+0]=='h'-'t'
			&& ciph[j+2]-ciph[j+1]=='i'-'h'
			&& ciph[j+3]-ciph[j+2]=='s'-'i'
			&& !islower(ciph[j+4])
			&& (j==0 || !islower(ciph[j-1]))){
				shift=ciph[j]-'t';
				if(shift<0)	shift+=26;
				break;
			}
		}
		for(int j=0;j<len-3;j++){
			if(ciph[j+1]-ciph[j+0]=='h'-'t'
			&& ciph[j+2]-ciph[j+1]=='a'-'h'
			&& ciph[j+3]-ciph[j+2]=='t'-'a'
			&& !islower(ciph[j+4])
			&& (j==0 || !islower(ciph[j-1]))){
				shift=ciph[j]-'t';
				if(shift<0)	shift+=26;
				break;
			}
		}
		for(int i=0;i<len;i++){
			if(islower(ciph[i])){
				ciph[i]-=shift;
				if(ciph[i]<'a')	ciph[i]+=26;
			}
		}
		cout<<ciph<<endl;
	}

	return 0;
}

C++: // AOJClearQuestion.cpp : C vWFNg t@CÅ·B

#include "stdafx.h"
#include <iostream>
#include <string>
#include <algorithm>
#include <map>
using namespace std;

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