Go: package main

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

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 reflect.DeepEqual(infos, []string{}) {
			break
		}
		fmt.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 <iostream>
#include <string>
using namespace std;

int main(int argc, const char * argv[])
{
    string str;
    while(getline(cin, str)){
        for (int i = 0; i < 26; i++) {
            for (int k = 0; k < str.size(); k++) {
                if (isalpha(str[k])) {
                    str[k]++;
                    if (str[k] > 'z') {
                        str[k] -= 26;
                    }
                }
            }
            if (str.find("the") != string::npos || str.find("that") != string::npos || str.find("this") != string::npos){
                goto finish;
            }
        }
    
finish:
        cout << str << endl;
    }
     return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
using namespace std;
string a,b;
char c[81];
int main(){
    while(getline(cin,a)){
        int flg=0;
        for(;;){
            if(flg==1)break;
            for(int i=0;i<26;i++){
                for(int j=0;j<a.size();j++){
                    if(a[j]>='a'&&a[j]<='z'){
                        if(a[j]-1>='a'){
                            a[j]-=1;
                        }else{
                            a[j]+=25;
                        }
                    }
                }
                for(int j=0;j<a.size()-3;j++){
                    b=a.substr(j,3);
                    if(b=="the")flg=1;
                    b=a.substr(j,4);
                    if(b=="that"||b=="this")flg=1;
                    if(flg==1)break;
                }
                if(flg==1)break;
            }
        }
    cout<<a<<endl;
    }
return 0;
}

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

typedef pair<string, string> P;

P next_word(string sentence) {
  if (sentence.empty()) return make_pair(string(""), string(""));
  if (sentence[0] == ' ' || sentence[0] == '.') {
    return make_pair("", sentence.substr(1));
  } else {
    P recur = next_word(sentence.substr(1));
    return make_pair(sentence[0] + recur.first, recur.second);
  }
}

bool acceptable(string sentence) {
  P p = next_word(sentence);

  while (! p.first.empty() ) {
    if (p.first == "this" || p.first == "the" || p.first == "that")
      return true;

    p = next_word(p.second);
  }
  return false;
}

char slip(char c) {
  if (c < 'a' || 'z' < c) return c;
  
  string alphabet = "abcdefghijklmnopqrstuvwxyza";
  int index = (int)(c - 'a');
  return alphabet[index + 1];
}

char slip(char c, int n) {
  for (int i = 0; i < n; i++)
    c = slip(c);

  return c;
}

string slip(string code, int n) {
  string val;
  for (int i = 0, len = code.length(); i < len; i++)
    val += slip(code[i], n);

  return val;
}

string decode(string code) {
  for (int i = 1; i < 27; i++) {
    string sentence = slip(code, i);
    if (acceptable(sentence))
      return sentence;
  }

  return "";
}

int main() {
  string code;
  while ( getline(cin, code) )
    cout << decode(code) << endl;
}