Go: package main

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

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 len(infos) == 0 {
			break
		}
		// 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 <iostream>
#include <string>
using namespace std;

int main() {    
    string line;
    
    while (getline(cin,line)) {
        for (int i = 0; i != 26; i++) {
            for (int j = 0; j != line.size(); j++) {
                if (isalpha(line[j])) {
                    line[j] = (line[j] - 'a' + 1) % 26 + 'a';
                }            
            }
            if (line.find("the") != string::npos || line.find("this") != string::npos || line.find("that") != string::npos) {break;}                    
        }
        cout << line << endl;
    }    
    return 0;
}

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