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

int main(){
	stirng s;
	while(getiline(cin,s)){
		while(s.find("the") == string::npos
				&& s.find("this") == string::npos
				&& s.find("that") == string::npos){
					for(int i = 0; i < s.size(): i++){
						if(s[i] == 'z')
							s[i] = 'a';
						else if(s[i] >= 'a' && s[i] <= 'z')
							s[i]++;
					}
				}
		cout << s << endl;		
	}
}

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;
}

C++: #include <stdio.h>
#include <math.h>

using namespace std;

int main(){

	char buf[81],result[81];
	bool FLG;
	short length;

	while(fgets(buf,81,stdin)!=0){
		FLG = false;
		length = 0;
		for(int i=0;buf[i]!='\0';i++)length++;
		for(int i=0;i<=25;i++){ //?????????????????°
			for(int k=0;buf[k]!='\0';k++){
				if(buf[k] >= 97 && buf[k] <= 122){
					if(buf[k]+i<=122){
						result[k]=buf[k]+i;
					}else{
						result[k]=97+(buf[k]+i-123);
					}
				}else{
					result[k]=buf[k];
				}
				result[k+1]='\0';
			}
			for(int k=0;result[k]!='\0';k++){
				// the this that ????????????????????????????????????
				if(length==4){
					if(result[0]=='t'&&result[1]=='h'&&result[2]=='e'&&result[3]=='.'){
						FLG=true;
						break;
					}
				}else{
					//??????
					if(result[0]=='t'&&result[1]=='h'&&result[2]=='e'&&result[3]==' '){
						FLG=true;
						break;
					}else if(result[0]=='t'&&result[1]=='h'&&result[2]=='i'&&result[3]=='s'&&result[4]==' '){
						FLG=true;
						break;
					}else if(result[0]=='t'&&result[1]=='h'&&result[2]=='a'&&result[3]=='t'&&result[4]==' '){
						FLG=true;
						break;
					}

					//????°?
					if(result[length-1]=='.'&&result[length-2]=='e'&&result[length-3]=='h'&&result[length-4]=='t'&&result[length-5]==' '){
							FLG=true;
							break;
					}
					if(length>5&&result[length-1]=='.'&&result[length-2]=='s'&&result[length-3]=='i'&&
							result[length-4]=='h'&&result[length-5]=='t'&&result[length-6]==' '){
							FLG=true;
							break;
					}else if(length>5&&result[length-1]=='.'&&result[length-2]=='t'&&result[length-3]=='a'&&
							result[length-4]=='h'&&result[length-5]=='t'&&result[length-6]==' '){
							FLG=true;
							break;
					}


					for(int p=4;result[p]!='\0';p++){
						if(result[p]==' ' && result[p-1] == 'e' && result[p-2] == 'h' && result[p-3] == 't' && result[p-4] == ' '){
							FLG = true;
							break;
						}
					}
					if(FLG)break;
					for(int p=5;result[p]!='\0';p++){
						if(result[p]==' ' && result[p-1] == 's' && result[p-2] == 'i' && result[p-3] == 'h' && result[p-4] == 't' && result[p-5] == ' '){
							FLG = true;
							break;
						}
					}
					if(FLG)break;
					for(int p=5;result[p]!='\0';p++){
						if(result[p]==' ' && result[p-1] == 't' && result[p-2] == 'a' && result[p-3] == 'h' && result[p-4] == 't' && result[p-5] == ' '){
							FLG = true;
							break;
						}
					}
					if(FLG)break;
				}
			}
			if(FLG)break;
		}
		printf("%s",result);

	}

    return 0;
}