Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	for scanner.Scan() {
		var result string
		line := scanner.Text()
		key := make(map[string]string)

		var i int32
		for ; i < 52; i++ {
			makeKey(key, i)
			result = decode(key, line)

			if strings.Contains(result, "the") {
				break
			} else if strings.Contains(result, "this") {
				break
			} else if strings.Contains(result, "that") {
				break
			}
		}

		fmt.Println(result)
	}
}

func makeKey(key map[string]string, shift int32) {
	for i := 'a'; i <= 'z'; i++ {
		cipher := (i + shift)
		if cipher > 'z' {
			cipher = cipher%'z' + 'a' - 1
		} else if cipher < 'a' {
			cipher = cipher + ('z' - 'a') + 1
		}
		key[string(i)] = string(cipher)
	}
}

func decode(key map[string]string, cipher string) string {
	var result string
	for _, v := range cipher {
		if key[string(v)] != "" {
			result += key[string(v)]
		} else {
			result += string(v)
		}
	}
	return result
}

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