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++: #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;
			}
		}
	}
}

C++: #include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
int main(){

    char a[1000];
    while(scanf("%[^\n]",a) != EOF){
        getchar();
        bool flg = 0;
        for(int i = 1; i < 26; i++){
            unsigned char ans[1000] = {0};
            for(int j = 0; j < strlen(a); j++){
                if(a[j] == ' ' || a[j] == '.') ans[j] = a[j];
                else ans[j] = a[j] + i;
                if(ans[j] > 'z') ans[j] -= 26;
            }
            for(int j = 0; j < strlen(a); j++){
                if(ans[j] == 't' && ans[j+1] == 'h'){
                    if(ans[j+2] == 'e' && ans[j+3] == ' ' || ans[j+3] == 0)flg = 1;
                    if(ans[j+2] == 'i' && ans[j+3] == 's' && ans[j+4] == ' ' || ans[j+4] == 0)flg = 1;
                    if(ans[j+2] == 'a' && ans[j+3] == 't' && ans[j+4] == ' ' || ans[j+4] == 0)flg = 1;
                }
                if(flg){
                    if(j == 0){
                        cout << ans << endl;
                        goto end;
                    }
                    else{
                        if(ans[j-1] == ' '){
                            cout << ans << endl;
                            goto end;
                        }
                    }
                }
            }
        }
        end:;
        for(int i = 0;i < 1000; i++) a[i] = 0;
    }

    return 0;
}