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>
using namespace std;
main(){
	string str;
	int tmp;
	while(getline(cin,str)){
		tmp=str[0]-'t';
		for(int i=0;i<str.size();++i){
			if(str[i]>='a' && str[i]<='z')str[i]-=tmp;
		}
		string str2="    ";
		for(int i=0;i<=3,i<=3;++i)str2[i]=str[i];
		if(str2=="this" || str2=="the " || str2=="that")cout<<str<<endl;
	}
}

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

std::string str;

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

	return 0;
}

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

int main(){
	string str[100];
	int k = 0;
	int zure[100];
	bool flag[100] = {false};
	while(getline(cin, str[k])){
		for(int j = 0; j < 26; j++){
			for(int i = 0; i < str[k].size()-2; i++){
				if(str[k][i] == 't'+j && str[k][i+1] == 'h'+j && str[k][i+2] == 'e'+j){
					zure[k] = j;
					flag[k] = true;
					break;
				}
			}
			if(flag[k] == true){
				k++;
				break;
			}
			for(int i = 0; i < str[k].size()-3; i++){
				if(str[k][i] == 't'+j && str[k][i+1] == 'h'+j && str[k][i+2] == 'i'+j && str[k][i+3] == 's'+j){
					zure[k] = j;
					flag[k] = true;
					break;
				}
			}
			if(flag[k] == true){
				k++;
				break;
			}
			for(int i = 0; i < str[k].size()-3; i++){
				if(str[k][i] == 't'+j && str[k][i+1] == 'h'+j && str[k][i+2] == 'a'+j && str[k][i+3] == 't'+j){
					zure[k] = j;
					flag[k] = true;
					break;
				}
			}
			if(flag[k] == true){
				k++;
				break;
			}
		}
	}
	for(int j = 0; j < k; j++){
		for(int i = 0; i < str[j].size(); i++){
			if(str[j][i] >= 'a' && str[j][i] <= 'z'){
				str[j][i] = str[j][i]-zure[j];
				if(str[j][i] < 'a'){
					str[j][i] = str[j][i]+26;
				}
			}
		}
		cout << str[j] << endl;
	}
}

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 i=0;i<a.length();i++)
     {
       if(a[i]>='a'&&a[i]<='z')
       { 
         char temp= a[i]<'e' ? (a[i]+26-4): (a[i]-4);
         b+=temp;
       }         
       else b+=a[i]; 
     }             
     for(int i=0;i<b.length();i++)
     {
       if(i>=80&&i%80==0) cout<<endl;
       else cout<<b[i]<<endl;        
     }
   }
   //while(1);      
   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 java.io.*;
import java.util.regex.Pattern;
public class Main {
    public static void main(String[] args) throws IOException{
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        Pattern pattern=Pattern.compile("the|this|that");
        String str;
        try{
            while((str=br.readLine())!=null){
                char[] ch=str.toCharArray();
                for(int j=0;!pattern.matcher(str).find()&j<26;j++){
                    for(int i=0;i<ch.length;i++){
                        if('a'<=ch[i]&&ch[i]<'z'){    //a???z??§????????????????????????
                            ch[i]++;
                        }else if(ch[i]=='z'){
                            ch[i]='a';  //z????¬????a
                        }
                    }
                    if(pattern.matcher(String.valueOf(ch)).find()){
                        break;
                    }
                }
                System.out.println(ch);
            }
        }catch(Exception e){
        }
    }
}

C++: #include <iostream>
#include <string>
using namespace std;
 
int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	string str;
	while(getline(cin, str)){
	
	while(1){
		for(size_t i = 0; i < str.size(); ++i){
			if('a' <= str[i] && str[i] <= 'z'){
				if(str[i] == 'z'){
					str[i] = 'a';
				}
				else {
					str[i]++;
				}
			}
		}
		bool check = false;
		for(size_t i = 0; i < str.size(); ++i){
			if(str[i] == 't' && (i == 0 || str[i - 1] == ' ')){
				if(str.substr(i, 3) == "the" && (str[i + 3] == ' ' || str[i + 3] == '.') ){
					check = true;
					break;
				}
				if((str.substr(i, 4) == "this" || str.substr(i, 4) == "that") && (str[i + 4] == ' ' || str[i + 4] == '.') ){
					check = true;
					break;
				}
			}
		}
		if(check){
			break;
		}
	}
	cout << str << 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(getline(cin,a))
   {
     for(int shift=1;shift<26;shift++)
     {
       b="";
       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(b.find("the")!=string::npos||b.find("this")!=string::npos||b.find("that")!=string::npos) break;
       else continue;
     }             
     for(int i=0;i<b.length();i++)
     {
       if(i>=80&&i%80==0) cout<<endl;
       cout<<b[i];        
     }
   }
   //while(1);      
   return 0;    
 }

C++: #include<iostream>
#include<cstdio>
#include<cstring>
#include<memory>

using namespace std;

int main(void)
{
    char Cipher[100],ans[100];
	int i=0,count=0;
	while (cin.getline(Cipher,sizeof(Cipher)))
	{
		memcpy(ans,Cipher,sizeof(Cipher));
		while(1)
		{
			char the[10]={'t','h','e'},ths[10]={'t','h','i','s'},that[10]={'t','h','a','t'};
			char *ans;

			if(count==25)break;
			ans=strstr(Cipher,the);
			if(ans!=NULL)break;
			ans=strstr(Cipher,ths);
			if(ans!=NULL)break;
			ans=strstr(Cipher,that);
			if(ans!=NULL)break;
			
			while(Cipher[i]!='\0')
			{
				if(Cipher[i]==' ')i++;
				if(Cipher[i]=='.')break;
				Cipher[i]=Cipher[i]++;
				if(Cipher[i]=='z') Cipher[i]='a';
				i++;
			}
			count++;
			i=0;
		}
		int number=0,i=0;
		if(count!=25)
		{
			while (Cipher[i]!='\0')
			{
				if(Cipher[i]==' ')i++;
				if(Cipher[i]=='.')break;
				number=(Cipher[i]-'a'+count)%26;
				ans[i]=number+'a';
				i++;
			}
		}
		cout<<Cipher<<endl;
		i=0,count=0;
	}
	return 0;
}