Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

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 scanner.Scan() {
		infos := strings.Split(scanner.Text(), " ")
		plain := make([]string, len(infos))
		// 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 <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>

const char *table = "abcdefghijklmnopqrstuvwxyz";

int search_number(const std::string &s)
{
    const char *key = "this";
    for (unsigned i = 0; i < s.size() - 3; ++i) {
        if (s[i] > s[i + 1] && s[i] - s[i + 1] == key[0] - key[1]
                || s[i] < s[i + 1] && s[i + 1] - s[i] == 26 - (key[0] - key[1])) {
            int n = s[i] - key[0];
            if (table[(s[i + 2] - 'a' - n) % 26] == key[2]
                    && table[(s[i + 3] - 'a' - n) % 26] == key[3])
                return n;
        }
    }
    return 0;
}

int main()
{
    std::string s;
    while (getline(std::cin, s)) {
        int n = search_number(s);
        for (unsigned i = 0; i < s.size(); ++i) {
            if (s[i] != ' ' && s[i] != ',' && s[i] != '.') {
                s[i] = table[(s[i] - 'a' - n) % 26];
            }
        }
        std::cout << s << std::endl;
    }
}

C++: #include <cstdio>
#include <cstring>
using namespace std;

char next(char c)
{
    if ('a' <= c && c <= 'y') {
        return c+1;
    } else if (c == 'z') {
        return 'a';
    }
    return c;
}

int main()
{
    char str[81];
    while(true) {
        if(!fgets(str,81,stdin)) break;
        for(int j=0;j<26;++j) {
            if (strstr(str, "the") || strstr(str, "this") || strstr(str, "that")) {
                break;
            }
            for(int k=0,len=strlen(str);k<len;++k) {
                str[k] = next(str[k]);
            }
        }
        fputs(str,stdout);
    }
    return 0;
}

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

int size;
string str;
void change()
{
  for (int i = 0; i < size; i++){
    if ('a' <= str[i] && str[i] <= 'y'){
      str[i]++;
    }
    else if (str[i] == 'z'){
      str[i] = 'a';
    }
  }
}

int main()
{
 // string str;

  while (getline(cin, str), str != ""){
    size = str.size();

    for (int i = 0; i < 24; i++){
      change();
      if (str.find("the") != -1 || str.find("this") != -1 || str.find("that") != -1){
        cout << str << endl;
        break;
      }
    }
    str = "";
  }
  return 0;
}

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

using namespace std;

int main(){
	const char *KEYWORDS[] = { "the", "this", "that" };
	string s;
	while(getline(cin, s)){
		for(int i = 0; i < 26; ++i){
			for(int j = 0; j < s.size(); ++j){
				if(islower(s[j])){ s[j] = (s[j] - 'a' + 1) % 26 + 'a'; }
			}
			bool accept = false;
			for(int j = 0; j < 3; ++j){
				if(s.find(KEYWORDS[j]) != string::npos){ accept = true; }
			}
			if(accept){ break; }
		}
		cout << s << endl;
	}
	return 0;
}

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

int main() {
  string str,s,newstr;
  int key,word;
  vector<string> seq;
  char decode[4],ans;
  while(getline(cin,str)) {
    stringstream ss;
    ss << str;
    while(ss >> s) {
      seq.push_back(s);
    }
    ss.str("");
    ss.clear(stringstream::goodbit);

    word = seq.size();
    key = 100;

    for(int i=0;i<word;i++) {
      if(seq[i].size() == 4) {// ??that.
	decode[0] = *seq[i].substr(0,1).c_str();
	decode[1] = *seq[i].substr(1,1).c_str();
	decode[2] = *seq[i].substr(2,1).c_str();
	decode[3] = *seq[i].substr(3,1).c_str();

	for(int j=1;j<27;j++) {
	  for(int k=0;k<4;k++) {
	    decode[k] -= 97; //a-z 0-25
	    decode[k] ++;//1-26
	    decode[k] %= 26;//0-25
	    decode[k] += 97;//97-122
	  }
	  if(decode[0] == 't' && decode[1] == 'h' && decode[2] == 'i' && decode[3] == 's') {
	    key = j;
	    break;
	  }
	  if(decode[0] == 't' && decode[1] == 'h' && decode[2] == 'a' && decode[3] == 't') {
	    key = j;
	    break;
	  }
	}
      }
      if(key!=100) break;
    }
    cout << key << endl;
    for(int i=0;i<word;i++) {
      for(int j=0;j<seq[i].size();j++) {
	ans = *seq[i].substr(j,1).c_str();
	if(ans <= 'z' && 'a' <= ans){
	  ans -= 97;
	  ans += key;
	  ans %= 26;
	  ans += 97;
	}
	cout << ans;
      }
      cout << " ";
    }
    cout << endl;
  }
}