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++: #include <iostream>
#include <string>
#include <vector>

using namespace std;

int main()
{
    vector<string> str;
    string input;
    int num[81];
    int slide = 0;
    const int al_num = 26;
    string s_the[al_num];
    string s_this[al_num];
    string s_that[al_num];    

    for (int i = 0; i < al_num; i++) {
        s_the[i].push_back(('t' + i - 'a') % al_num + 'a');
        s_the[i].push_back(('h' + i - 'a') % al_num + 'a');
        s_the[i].push_back(('e' + i - 'a') % al_num + 'a');
    }

    for (int i = 0; i < al_num; i++) {
        s_this[i].push_back(('t' + i - 'a') % al_num + 'a');
        s_this[i].push_back(('h' + i - 'a') % al_num + 'a');
        s_this[i].push_back(('i' + i - 'a') % al_num + 'a');
        s_this[i].push_back(('s' + i - 'a') % al_num + 'a');
    }
    for (int i = 0; i < al_num; i++) {
        s_that[i].push_back(('t' + i - 'a') % al_num + 'a');
        s_that[i].push_back(('h' + i - 'a') % al_num + 'a');
        s_that[i].push_back(('a' + i - 'a') % al_num + 'a');
        s_that[i].push_back(('t' + i - 'a') % al_num + 'a');
    }

    for (int i = 0; i < al_num; i++)
        num[i] = -1;

    int i = 0;
    while (cin >> input) {
        num[i++] = input.size();
        str.push_back(input);
    }
    str[i - 1].erase(str[i - 1].size() - 1);
    num[i - 1]--;

    bool loop = false;
    for (int i = 0; num[i] != -1; i++) {
         if (num[i] == 3) { // "the"
             for (int j = 0; j < al_num; j++) {
                if (str[i] == s_the[j]) {
                    slide = j;
                    loop = true;
                    break;
                }
            }
        }
        else if (num[i] == 4) { // "this", "that"
            for (int j = 0; j < al_num; j++) {
                if (str[i] == s_this[j] || str[i] == s_that[j]) {
                    slide = j;
                    loop = true;
                    break;
                }
            }
        }
        
        if (loop)
            break;
    }
    
    // output
    for (int i = 0; num[i] != -1; i++) {
        for (int j = 0; j < num[i]; j++) {
            char c;
            if (str[i][j] - slide < 'a')
                c = 'z' - ('a' - 1 - (str[i][j] - slide));
            else
                c = (str[i][j] - slide - 'a') % al_num + 'a';
            cout << c;
        }
        cout << ' ';
    }
    cout << '\b' << '.' << endl;

    return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include<string.h>
#include<ctype.h>

int main()
{
	char str[90];
	
	while( fgets( str, 81, stdin ) != 0 ){
		while( 1 ){
			for( int i = 0; i < strlen( str ); i++ ){
				if( isalpha( str[i] ) ) str[i]++;
				
				if( str[i] > 'z' ){
				 	str[i] = 'a';
				}
			}
			
			if( strstr( str, "the" ) != NULL || strstr( str, "this" ) != NULL || strstr( str, "that" ) != NULL ) break;
		}
		
		std::cout << str << std::endl;
	}

 	return 0;
}

C++: #include<string>
#include<iostream>
#include<algorithm>
using namespace std;
string henkan(string a)
{
	for (unsigned int i = 0; i < a.size(); i++)
	{
		if (a[i] != ' '&&a[i] != '.'&&a[i]!='\n')
		{
			if (a[i] == 'z')a[i] = 'a';
			else 
				a[i] += 1;
		}
	}
	return a;
}
bool check(string a)
{
	string x[3] = { "the", "this", "that" };
	for (int i = 0; i < 3; i++)
	{
		if (a.find(x[i], 0) != string::npos)return false;
	}
	return true;
}
int main()
{
	
	string a, b;
	while (getline(cin, a))
	{
		while (check(a))
		{
			a = henkan(a);
		}
		cout << a << endl;
	}
	
}

C++: import java.util.*;
import static java.lang.System.*;
import java.math.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		String s = sc.nextLine();
		
		for (int i=0; i<26; i++) {
			StringBuilder sb = new StringBuilder();
			char c;
			
			for (int j=0; j<s.length(); j++) {
				c = s.charAt(j);
				if (c!='.' && c!=' ') {
					c -= i;
					if (c < 97) {c+=26;}
				}
				sb.append(c);
			}
			
			if (sb.toString().matches(".*(the|this|that).*")) {out.println(sb);}
		}
	}
}

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++: #include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
using namespace std;

bool howMuchWords(string s, string key){
  string::size_type index = s.find(key);
  if(index == string::npos){
    return false;
  }else{
    //???????????£???.
    return true;
  }
}
    

int main(){
  string s;
  getline(cin ,s);
  int cnt=0;
  
  
  while(true){
    bool flag=false;
    for(int i=0;i<s.length();i++){
      string key1 = s.substr(i,3);
      string key2 = s.substr(i,4);
    // if(howMuchWords(s, "that") || howMuchWords(s, "this") || howMuchWords(s, "the")){
      // cout << cnt << ": ";
      // cout << s << endl;
      // break;
      if(key1 == "the" || key2 == "this" || key2 == "that"){
	flag = true;
	break;
      }
    }
    
    if(flag){
      cout << s << endl;
      break;
    }
    
    for(int i=0;i<s.length();i++){
      if(s[i] > 'a' && s[i] < 'z'){
	s[i] -= 'a';
	s[i] -= 1;
	if(s[i] < 0){
	  s[i] += 'A' - 'a';
	}
	s[i] += 'a';
      }
    }
    
  }
}

C++: #include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <iterator>
#include <stack>
typedef long long int lli;
using namespace std;

int main(){
	string str;
	while(getline(cin,str)){
		for(int i=1; i<=25; ++i){
			string tmp=str;
			for(int j=0; j<str.size(); ++j){
				if('A'<=str[j]&&str[j]<='Z'){
					if('A'<=tmp[j]+i&&tmp[j]+i<='Z'){
						tmp[j]=tmp[j]+i;
					} else {
						tmp[j]=tmp[j]+i+'A'-'Z'-1;
					}
				} else if('a'<=str[j]&&str[j]<='z'){
					if('a'<=tmp[j]+i&&tmp[j]+i<='z'){
						tmp[j]=tmp[j]+i;
					} else {
						tmp[j]=tmp[j]+i+'a'-'z'-1;
					}
				}
			}
			if(tmp.find("the")!=-1||tmp.find("this")!=-1||tmp.find("that")!=-1){
				cout << tmp << endl;
				break;
			}
		}
	}
	return 0;
}