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<cmath>
#include<vector>
#include<list>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<string>
#include<utility>
#include<algorithm>
#include<functional>
#include<deque>
#include<string.h>
#include<ctype.h>
#include<time.h>
#include<stdlib.h>
using namespace std;

char c[80], word[80][15];
int p = 0, q = 0;

bool search_th(){
  for (int i = 0; i < p; i++){
    if (word[i][0] == 't' && word[i][1] == 'h'){
      if (word[i][2] == 'e' || (word[i][2] == 'i' && word[i][3] == 's') || (word[i][2] == 'a' && word[i][3] == 't')){
        return true;
      }
    }
  }
  return false;
}

void split_words(){
  for (int i = 0; i < 80; i++){
    for (int j = 0; j < 15; j++){
      word[i][j] = '\0';
    }
  }
  for (int i = 0; i < strlen(c); i++){
    if (c[i] >= 'a' && c[i] <= 'z'){
      word[p][q++] = c[i];
    } else {
      p++;
      word[p++][0] = c[i];
    }
  }
}

int main(){
  while (cin.getline(c, sizeof(c))){
    split_words();
    while (1){
      if (search_th() == true){
        for (int i = 0; i < p; i++){
          cout << word[i];
        }
        puts("");  break;
      } else {
        for (int i = 0; i < p; i++){
          for (int j = 0; j < strlen(word[i]); j++){
            if (word[i][j] >= 'a' && word[i][j] <= 'y') word[i][j]++;
            if (word[i][j] == 'z')                      word[i][j] = 'a';
          }
        }
      }
    }
    for (int i = 0; i < 80; i++){
      c[i] = '\0';
    }
  }
  return 0;
}

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

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

C++: #include<cstring>
#include<cstdio>
#include<iostream>

#define REP(n) for(int i=0;i<n;i++)

using namespace std;


int main(){
	char a[100];

	while(NULL!=fgets( a, 80, stdin)){
		int n=strlen(a);

		while(NULL==strstr(a,"the")&&NULL==strstr(a,"this")&&NULL==strstr(a,"that")){
			REP(n){
				if('a'<=a[i] && a[i]<'z')	a[i]++;
				else if('z'==a[i]) a[i]='a';
			}
		}

	fprintf(stdout, "%s\n",a);
	}

	return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <stdlib.h>
#include <vector>

using namespace std;


int main(){

	string line;

	while(getline(cin, line)){

		string str[80], ans[80];
		int count = 0;
		int flag = 0;
		int slide;

		//???????????????
		
		string temp;
		for(int i=0 ; i<line.size()-1 ; i++){
			temp += line[i];
		}
		line = temp;
		

		//???????????????????????¨???????´?
		for(int i=0 ; i<line.size() ; i++){
			if(line[i] == ' '){
				count++;
			}else{
				str[count] += line[i];
				ans[count] = str[count];
			}
		}
		count++;


		for(int i=1 ; i<=26 ; i++){
			for(int j=0 ; j<count ; j++){
				for(int k=0 ; k<str[j].size() ; k++){
					if(str[j][k] != '.'){
						str[j][k]++;
						if(str[j][k] > 'z'){
							str[j][k] = str[j][k] - 'z' + 'a' -1;
						}
					}
					if(str[j][k] == 'h' && str[j][k-1] == 't'){
						flag = 1;
						slide = i;
						break;
					}
				}

				/*
				if(str[j] == "this" || str[j] == "the" || str[j] == "that"
						|| str[j] == "this." || str[j] == "the." ||str[j] == "that."){
					flag = 1;
					slide = i;
					break;
				}
				*/
			}
			if(flag == 1)break;
		}

		for(int i=0 ; i<count ; i++){
			for(int j=0 ; j<ans[i].size() ; j++){
				if(ans[i][j] != '.'){
					if((ans[i][j] + slide) > 'z' ){
						ans[i][j] = ans[i][j] - 'z' + 'a' + slide -1;
					}else{
						ans[i][j] = ans[i][j] + slide ;
					}
				}
			}
		}

		for(int i=0 ; i<count ; i++){
			cout << ans[i] << ' ';
		}
		cout << ans[count] << endl;

	}
	return 0;
}

C++: #include <iostream>
using namespace std;
#include <stdio.h>
#include <string.h>
#include <string>
#include <algorithm>
#include <vector>

void q17() {
	vector<string> hints;
	hints.push_back("the");
	hints.push_back("this");
	hints.push_back("that");

	vector< vector<string> > shiftHints;
	for (int i = 0; i < 26; i++) {
		vector<string> iShiftHints;
		for (int j = 0; j < hints.size(); j++) {
			string tmp = "";
			for (int k = 0; k < hints[j].length(); k++) {
				char z = ((hints[j][k] - 'a' + i) % 26) + 'a';
				tmp += ((hints[j][k] - 'a' + i) % 26) + 'a';
			}
			iShiftHints.push_back(tmp);
		}
		shiftHints.push_back(iShiftHints);
	}

	string str;
	for (; getline(cin, str);) {
		int s;
		bool flag = false;
		for (s = 0; s < 26; s++) {
			for (int i = 0; i < hints.size(); i++) {
				if (str.find(shiftHints[s][i]) != -1) {
					flag = true;
				}
			}
			if (flag) break;
		}

		string ans = "";
		for (int i = 0; i < str.length(); i++) {
			if ('a' <= str[i] && str[i]<= 'z') {
				ans += (str[i] - 'a' - s) % 26 + 'a';
			}
			else {
				ans += str[i];
			}
		}
		cout << ans << endl;
	}
}

int main() {
	q17();
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <sstream>

using namespace std;

bool is_comprehensible(const string& str){
	istringstream iss(str);
	string word;
	while(iss >> word){
		if(word == "the" || word == "this" || word == "that"){
			return true;
		}
	}
	return false;
}

string shift_string(const string& str, char n){
	string result;
	for(auto& v: str){
		if('a' <= v && v <= 'z'){
			result += (v - 'a' + n) % 26 + 'a';
		}
		else{
			result += v;
		}
	}
	return result;
}

int main(){
	string str;
	while(getline(cin, str)){
		for(int i = 0; i < 26; ++i){
			auto shifted = shift_string(str, i);
			if(is_comprehensible(shifted)){
				cout << shifted << endl;
				break;
			}
		}
	}
	return 0;
}