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++: import java.io.*;

public class main{
	public static void main(String[] args) throws IOException{
		try{
	        InputStreamReader isr = new InputStreamReader(System.in);
	        BufferedReader br = new BufferedReader(isr);
	        String str;
	        String target[];
	        int  checkResult = 99;
	        int caesar;
	        
	        while( (str = br.readLine()) != null){
	        	caesar = 0;
	        	target =  str.split(" ");
		        for(int i = 0; i < target.length; i++){    		
	        		checkResult = checkPattern(target[i]);
	        		if(checkResult != 99){
	        			caesar = checkResult;
	        			break;
	        		}
	        	}
	        
	            StringBuilder result = new StringBuilder();
	            for(int i = 0; i < target.length; i++){
	        	    result.append(makeCaeserString(target[i],caesar));
	        	    result.append(" ");
	            }        
	            System.out.println(result);	        	
	        }	        
		}catch(Exception e){
			System.out.println(e);
		}
	}

	private static int checkPattern(String str){
		
		String target[];
		target = str.split("\\.");
		int result  = 99;
		
		for(int i = 0; i < target.length; i++){
			result = isThe(target[i]);
			if(result != 99) break;
			result = isThis(target[i]);
			if(result != 99) break;
			result = isThat(target[i]);
			if(result != 99) break;
		}
		return result;
	}
	
	private static int isThe(String str){
		
		String newStr;
		String  target = "the";
		int result = 99;
		
		if(str.length() != target.length()) return result;
		
		for(int i = -26; i < 27; i++){
			//str.charAt(j)???str???j????????????????????????
			newStr =  String.valueOf((char)(str.charAt(0)+i))
					 + String.valueOf((char)(str.charAt(1)+i))
				     + String.valueOf((char)(str.charAt(2)+i));
			
			if( newStr.equals(target) ){
				result = i;
				break;
			}
		}
		return result;
	}
	
	private static int isThis(String str){
		
		String newStr;
		String  target = "this";
		int result = 99;;
		
		if(str.length() != target.length()) return result;
		
		for(int i = -26; i < 27; i++){
			//str.charAt(j)???str???j????????????????????????
			newStr =  String.valueOf((char)(str.charAt(0)+i))
					 + String.valueOf((char)(str.charAt(1)+i))
				     + String.valueOf((char)(str.charAt(2)+i))
			         + String.valueOf((char)(str.charAt(3)+i));
			
			if( newStr.equals(target) ){
				result = i;
				break;
			}
		}
		return result;
	}	
  private static int isThat(String str){
	
	String newStr;
	String  target = "that";
	int result = 99;;
		
	if(str.length() != target.length()) return result;
	
	for(int i = -26; i < 27; i++){
		//str.charAt(j)???str???j????????????????????????
		newStr =  String.valueOf((char)(str.charAt(0)+i))
				 + String.valueOf((char)(str.charAt(1)+i))
			     + String.valueOf((char)(str.charAt(2)+i))
			     + String.valueOf((char)(str.charAt(3)+i));
		
		if( newStr.equals(target) ){
			result = i;
			break;
		}
	}
	return result;
  }
  
  private static String makeCaeserString(String str,int n){
	  
	  int intA = 'a';
	  int intZ = 'z';
	  int zure = 0;
	  String result = "";
	  	  
	  for(int i = 0; i < str.length(); i++){
		  if(str.charAt(i)<intA || str.charAt(i) > intZ){
			  return str;
		  }else if( (str.charAt(i)) == ".".charAt(0)){
			  zure = -n;
		  }else if( str.charAt(i) + n < intA ){
			  zure = 26;
		  }else if(str.charAt(i) + n > intZ){
			  zure = -26;
		  }
		  result += String.valueOf((char)(str.charAt(i)+n+zure));
	      zure = 0;
	  }
	  return result;
  }
}

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(){
    char in[100];
    string S;
    vector<string> vec;
    
    while(EOF!=scanf("%s",in)){
        
        S = in;
        vec.push_back(S);
    }
    
    for(int k=0;k<26;k++){
        
        bool f = false;
        
        for(int i=0;i<vec.size();i++){
            for(int j=0;j<vec[i].size();j++){
                if(vec[i][j]!='.')vec[i][j]++;
                
                if(vec[i][j] > 'z') vec[i][j]='a';
            }
            
            if(vec[i]=="the" || vec[i]=="that" || vec[i]=="this"){
                
                f = true;
                
            }
        }
        
        if(f) break;
    }
    
    for(int i=0;i<vec.size();i++){
        cout << vec[i];
        if(i == vec.size()-1) cout << endl;
        else cout << " ";
    }
    
    return 0;
}

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

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

C++: #include <bits/stdc++.h>
using namespace std;
//????????????????????????????????????
void Check(const string& str){
  string strparent=str;
  int gap=1;
  while(strparent.find("the")==(string::npos)&&
        strparent.find("this")==(string::npos)&&
        strparent.find("that")==(string::npos)){
    for(int i=0;i<str.length();i++){
      if(!isalpha(str[i]))continue;//" "
      //strparent[i]=(gap+str[i]-'a')%26+'a';
      strparent[i]=(gap+str[i])%26+'a';
    }
    gap++;
  }
  cout<<strparent<<endl;
}

int main(){
  string str;
  while(getline(cin,str)){
    Check(str);
  }
}

C++: #include <bits/stdc++.h>
using namespace std;

string change(string s)
{
	string ss = "";
	for(int i = 0; i < s.length(); i++){
		if(isalpha(s[i])){
			if(s[i] >= 'a' && s[i] <= 'd')
				ss += 'z' - (s[i] - 'a');
			else
				ss += s[i] - 4;
		}
		else
			ss += s[i];
	}
	return ss;
}

int main(void)
{
	string s;

	while(getline(cin, s)){
		cout << change(s) << endl;
	}

	return 0;
}