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++: #include<iostream>
#include<cstdio>
#include<string>
#include<cstring>
#include<vector>
using namespace std;
int word_search(vector<string> s,  string key){
    for(int i = 0; i < s.size(); i++){
        if(s[i].length() <= 2 || s[i].length() >= 6) continue;
        for(int j = 0; j < s[i].length() - 1; j++)
            if(s[i][j] == '.') continue;
        if(s[i][s[i].length() - 1] == '.') s[i].erase(s[i].end() - 1);
        for(int j = 0; j < 26; j++){
            string turned_word;
            for(int k = 0; k < s[i].length(); k++){
                turned_word.push_back((s[i][k] + j - 'a') % 26 + 'a');
            }
            if(turned_word == key) return j;
        }
    }
    return -1;
}
int main(){
    for(;;){
        char line[200];
        if(fgets(line, sizeof(line), stdin) == NULL) break;
        vector<string> s;
        char *token = strtok(line, " ");
        s.push_back(token);
        for(;;){
            token = strtok(NULL, " ");
            if(token == NULL) break;
            s.push_back(token);
        }
        int num;
        if(word_search(s, "the") != -1) num = word_search(s, "the");
        if(word_search(s, "this") != -1) num = word_search(s, "this");
        if(word_search(s, "that") != -1) num = word_search(s, "that");
        for(int i = 0; i < s.size(); i++){
            for(int j = 0; j < s[i].length(); j++){
                if(s[i][j] == '.') cout << '.';
                else if(s[i][j] == '\n') continue;
                else cout << (char)((s[i][j] + num - 'a') % 26 + 'a');
            }
            cout << ' ';
        }
    }
    return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
int caesar(char s[]);
bool search(string s);

int main(){
	string str;
	int i;
	while(getline(cin,str)){
		int j=0;
		while(!search(str)){
			for(i=0;str[i]!='.';i++){
				if(str[i]!=' ') str[i]++;
				if(str[i]>122) str[i]=97;
			}
			j++;
			if(j>25) break;
		}
		cout << str << endl;
	}
	return 0;
}

bool search(string s){
	if(s.find("this")!=string::npos) return true;
	if(s.find("that")!=string::npos) return true;
	if(s.find("the")!=string::npos) return true;
	return false;
}

C++: #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define shosu(n) setprecision(n)
#define INF 1000000000;
using namespace std;
int main() {
  string n;
  while (getline(cin, n)) {
    string ans = n;
    for (int i = 0; i < 26; i++) {
      if (ans.find("the") != -1 || ans.find("that") != -1 ||
          ans.find("this") != -1)
        break;
      for (int j = 0; j < ans.size(); j++) {
        if (ans[j] == ' ' || ans[j] == '.')
          continue;
        if (ans[j] == 'z')
          ans[j] = 'a';
        else
          ans[j]++;
      }
    }
    cout << ans << endl;
  }
  return 0;
}

C++: #include<bits/stdc++.h>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<algorithm>
using namespace std;

#define PI 3.1415926535897932
// #54797
int main(){
    int len,flg;
    char s[84];
    while (fgets(s,84,stdin)!=NULL) {
        len=strlen(s)-1;
        flg=1;

        while (flg) {
            for (int i=0;i<len;i++) {
                if (islower(s[i])) {
                    s[i]=(s[i]-'a'+1)%26+'a';
                }
            }
            for (int i=0;i<len;i++) {
                if (!strncmp(&s[i],"the",3) || !strncmp(&s[i],"this",4) || !strncmp(&s[i],"that",4)) {
                    flg=0;
                    break;
                }
            }
        }
        printf("%s",s);
    }
    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<string>

std::string str;

int main()
{
	while( std::getline( std::cin, str ) )
	{
		for( int i = 0; 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;
}