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++: #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <regex>
#include <cctype>
#include <string>
#include <utility>
using namespace std;

vector<string> v;

vector<string> split(string&& s, regex&& pattern) {
    sregex_token_iterator first(s.begin(), s.end(), pattern, -1);
    sregex_token_iterator last;
    return(vector<string>(first, last));
}

bool cheser() {
    for(int r = 1; r <= 26; r++) {
        bool found = false;
        for(int c = 0; c < v.size(); c++) {
            for(int k = 0; k < v[c].length(); k++) {
                if(!isalpha(v[c][k])) continue;
                int now = v[c][k] - 'a';
                now = (now+1)%26;
                v[c][k] = 'a' + now;
            }
            if(v[c] == "the" || v[c] == "this" || v[c] == "that") found = true;
        }
        if(found) return(true);
    }
    return(false);
}

int main(void) {
    string input;
    while(getline(cin, input)) {
        v = split(move(input), regex(" "));
        cheser();
        for(int r = 0; r < v.size(); r++) {
            cout << v[r];
            if(r == v.size() - 1) cout << endl;
            else                  cout << " ";
        }
    }
    
    return(0);
}

C++: #include<iostream>
#include<string>
#include<vector>
using namespace std;
char CaesarChar(char );
string CaesarString(string s);
vector<string> CaesarVector(vector<string> v);
vector<string> SolveCaesar(vector<string> v);
int main() {
  string s;
  while( getline(cin,s)) {  
    vector<string> array;
    int space=0;
    int next_space=0;    
    for(int i=0;i<(int)s.size();i++) {
      if(s[i]== ' '){
	next_space=i;
	string tmp="";
	for(int j=space;j<next_space;j++)
	  tmp+=s[j];
	space=next_space+1;
	array.push_back(tmp);
      }
    }
    string tmp="";
    for(int i=next_space+1;i<(int)s.size();i++) 
      tmp+=s[i];
    array.push_back(tmp);
    vector<string> answer=SolveCaesar(array);
    for(int i=0;i<(int)answer.size();i++){
      cout<<answer[i];
      if(i!=(int)answer.size()-1)
	cout<<" ";
    } 
    cout<<endl;
  }
  return 0;
}
char CaesarChar(char c) {
  if(c=='z')
    return 'a';
  if(int('a')<=int(c) && int(c)<int('z'))
  return char(c+1);
  return c;
}
string CaesarString(string s) {
  string tmp="";
  for(int i=0;i<(int)s.size();i++)
    tmp+=CaesarChar(s[i]);
  return tmp;
}
vector<string> CaesarVector(vector<string> v) {
  vector<string> tmp;
  for(int i=0;i<(int)v.size();i++) 
    tmp.push_back(CaesarString(v[i]));
  return tmp;
}
vector<string> SolveCaesar(vector<string> v) {
  for(int i=0;i<(int)v.size();i++) {
    if(v[i]=="the" || v[i]=="this" || v[i]=="that")
      return v;
  } 
  return SolveCaesar(CaesarVector(v));
}

C++: #include<iostream>
#include<string>
#include<sstream>
#include<vector>


std::vector<std::string> split(const std::string &s, char delim) {
	std::vector<std::string> elems;
	std::stringstream ss(s);
	std::string item;
	while (std::getline(ss, item, delim)) {
		if (!item.empty()) {
			elems.push_back(item);
		}
	}
	return elems;
}

int main() {
	std::string input;
	while (std::getline(std::cin, input)) {
		std::vector<std::string> words;
		bool isPeriod = false, isCipher = false;
		if (*(input.rbegin()) == '.') {
			input.pop_back();
			isPeriod = true;
		}
		words = split(input, ' ');
		for (int i = 0; i < 26; i++) {
			for (std::vector<std::string>::iterator itr = words.begin(); itr != words.end(); itr++) {
				for (std::string::iterator sitr = (*itr).begin(); sitr != (*itr).end(); sitr++) {
					*sitr = ((*sitr - 'a' + 1) % 26) + 'a';
				}
				if (*itr == "the" || *itr == "this" || *itr == "that") {
					isCipher = true;
				}
			}
			if (isCipher) break;
		}
		std::string output = "";
		for (std::vector<std::string>::iterator itr = words.begin(); itr != words.end(); itr++) {
			if (output != "") output += " ";
			output += *itr;
		}
		if (isPeriod) output += ".";
		std::cout << output << std::endl;
	}
}

C++: #include <iostream>
#include <string>

using namespace std;

int main(int argc, char *argv[]) {
  string str, copy;
  int shif;
  getline(cin, str);

  copy = str;
  shif = -1;
  while (true) {
    if (str.find(" this ") != string::npos ||
        str.find(" that ") != string::npos ||
        str.find(" the ") != string::npos)
      break;
    else
      for (string::iterator itr = str.begin();
           itr != str.end();
           itr++)
        if ('a' <= *itr && *itr <= 'z') {
          *itr += shif;
        } else if (*itr != '.' && *itr != ' ' &&
                   *itr != '\n') {
          str = copy;
          shif = 1;
          break;
        }
  }


  cout << str << endl;
  return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
  string str;
  while(getline(cin,str)){
    
    for(int i=0;i<str.size();i++){
      
      if(str[i] >= 'a' && str[i] <= 'z'){
	int a = (26+(str[i]-'a'-4))%26;
	str[i] = ('a'+a);
      }
      cout << str[i];
    }
    cout << endl;
  }
  return (0);
}

C++: #include <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <sstream>

using namespace std;

#define reep(i,f,n) for(int i=f; i<int(n); ++i)
#define rep(i,n) reep(i,0,n)

typedef vector<int> vi;

int main()
{
	char str[81];
	while(fgets(str, 81, stdin) != NULL){
		stringstream sstr(str);
		vector<string> words;

		string tmp;
		while(sstr >> tmp)
			words.push_back(tmp);

		rep(i, 26){
			rep(j, words.size()){
				if(words[j] == "the" || words[j] == "this" || words[j] == "that"){
					rep(k, strlen(str))
						putchar(isalpha(str[k]) ? (str[k]-'a'+i)%26+'a' : str[k]);
					//puts("");
					i = 26;
					break;
				}

				rep(k, words[j].size())
					words[j][k] = (words[j][k]-'a'+1)%26 + 'a';
			}
		}
	}

	return 0;
}