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<vector>
#include<string>

std::string Caesar(std::string str, int tranceNum )
{
	for(size_t i=0; i<str.length(); ++i)
	{
		if('a'<=str[i] && str[i]<='z')
		{
			int chNum = 0;
	
			chNum = str[i];

			chNum += tranceNum;

			chNum = (chNum-97)%26+97;
	
			str[i] = chNum;	
		
		}
	}

	return str;
}

int main()
{
	std::string sentence;

	while(std::getline(std::cin,sentence))
	{
		bool flg=0;

		
		for(;;)
		{
			sentence=Caesar(sentence,1);

			std::string checkword = ""; 

			size_t i=0;

			for( ; i<sentence.size() && flg==0; ++i)
			{
				switch(sentence[i])
				{
				case 't': case 'h': case 'i': case 's': case 'a': case 'e':
					checkword+=sentence[i];
					break;
				default :
					checkword = "";
					break;
				}

				if(checkword=="this" || checkword=="the" || checkword=="that")
				{
					break;
				}
			}
			if(i!=sentence.size())
			{
				std::cout << sentence << '\n';

				break;
			}
		}
	}
}

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

using namespace std;

char data[26]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
char trans[100];
char mozi;
int position=0;
int zoom;
int first_check=0,first_position=0;
int now;
char result;

int main(){
	while(scanf("%c",&mozi) != EOF){

		if(first_check == 0)

		for(int i=0;i<26 && first_check == 0;i++){
			if(mozi == data[i]){
				first_position = i;
				zoom = first_position - 19;
				first_check = 1;
			}
		}




		if(mozi == ' ' || mozi == '.' || mozi == '\n'){
			if(mozi == ' ' || mozi == '.'){
				trans[position] = mozi;
				position++;
			}

			if(mozi == '\n'){
				trans[position] = '\n';
				cout << trans << endl;
				first_check = 0;
				position = 0;
				memset(trans,'\0',sizeof(trans));
			}
		}else{
			for(int i=0;i<26;i++){
				if(data[i] == mozi){
					now = i;
					break;
				}
			}

			trans[position] = data[now - zoom];
			position++;

		}
	}
}

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

using namespace std;
int main(void)
{
	while(1)
	{
		char a[10000] = {0};
		if(gets(a) == NULL) break;
		int as = strlen(a);
		for(int i = 0;i < 26;i++)
		{
			if(strstr(a,"this") || strstr(a,"that") || strstr(a,"the")) break;
			for(int j = 0;j < as;j++)
			{
				if(isalpha(a[j]))
				{
					a[j] = (a[j] - 'a') % 26 + 'a';
				}
			}
		}
		printf("%s\n",a);
	}
	return 0;
}

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

using namespace std;

string findtest;

int main(void){
  
  while( getline( cin , findtest ) ){
    while( findtest.find("the") == findtest.npos && findtest.find("that") == findtest.npos && findtest.find("this") == findtest.npos ) {
      // ここでthe.that.thisが見つかるまで文字を１つずつ動かす
      //１つでも見つかればwhileを抜け出して出力
      for( int i = 0 ; i < findtest.size() ; i++ ){
	//このforで全ての文字を１つずらす
	if( 'a' <= findtest[i] && findtest[i] <= 'y' )findtest[i]++;
	else if( findtest[i] == 'z' ) findtest[i] = 'a';
      }
    }
    cout << findtest << endl;
  }
  return 0;
}

C++: #include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b) - 1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)

#define PB push_back
#define INF INT_MAX/3
#define ALL(a) (a).begin(),(a).end()
#define CLR(a) memset(a,0,sizeof(a))

typedef long long int ll;

using namespace std;

int main(){

    string s[] = {"the","this","that"};
    string in;
    while(true){
	getline(cin,in);
	if(cin.eof()) break;
	bool f = false;
	int d = 1;
	REP(i,30){

	    f = true;
	    REP(i,in.size()){
		if(in[i] == '.' || in[i] == ' ') continue;
		in[i]= (char)( 'a' + ( (int)(in[i] - 'a') + d) % 28);
	    }
	    vector<bool> flgs(3,false);
	    for(int i=0;i<in.size();i++){
		REP(j,3){
		    if(in.substr(i,s[j].size()) == s[j]) flgs[j] = true;
		}
	    }
	    if(flgs[0] && (flgs[1] || flgs[2])) break;
	}
	cout << in << endl;
    }

    return 0;
}

C++: #define _USE_MATH_DEFINES
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<list>
#include<stack>
#include<queue>
#include<iomanip>
#include<functional>
using namespace std;
typedef long long llong;
int main() {
	int p, q, r;
	string x = "this the that";
	//cout << x.find("the") << endl << x.find("that") << endl << x.find("this") << endl;
	string a = "abcde";
	//cout << (int)a.find("the") << endl << (int)a.find("that") << endl << (int)a.find("this") << endl;
	string s;
	while (getline(cin, s)) {
		//cout << (int)s.find("the") << endl << (int)s.find("that") << endl << (int)s.find("this") << endl;
		for (int j = 0;; j++) {
			p = (int)s.find("the");
			q = (int)s.find("that");
			r = (int)s.find("this");
			//cout << p << q << r << endl;
			if (p >= 0 || q >= 0 || r >= 0) {
				cout << s << endl;
				break;
			}
			for (int i = 0; i < s.size(); i++) {
				if (isalpha(s[i])) {
					if (s[i] == 'z')s[i] = 'a';
					else s[i]++;

				}
			}
		}
	}
	return 0;
}