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>
using namespace std;
 
int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	string str;
	getline(cin, str);
	
	while(1){
		for(size_t i = 0; i < str.size(); ++i){
			if('a' <= str[i] && str[i] <= 'z'){
				if(str[i] == 'z'){
					str[i] = 'a';
				}
				else {
					str[i]++;
				}
			}
		}
		bool check = false;
		for(size_t i = 0; i < str.size(); ++i){
			if(str[i] == 't'){
				if(str.substr(i, 3) == "the" || str.substr(i, 4) == "this" || str.substr(i, 4) == "that"){
					check = true;
					break;
				}
			}
		}
		if(check){
			break;
		}
	}
	cout << str << endl;
	
	return 0;
}

C++: #include <bits/stdc++.h>
#define ll long long
#define vl vector<ll>
#define pl pair<ll,ll>
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,b) for(ll i=0;i<b;i++)
#define RFOR(i,a,b) for(ll i=b-1;i>=a;i--)
#define rsort(v) sort((v).rbegin(), (v).rend())
#define all(v) (v).begin(),(v).end()
using namespace std;
ll mod=1000000007;

signed main(){
    string s;
    while (getline(cin, s)) {
        for(int j=0 ; j<26 ; j++){
            for(int i=0 ; i<s.size() ; i++){
                if(s[i]>='a' && s[i]<='z' ) s[i] = (s[i]=='z')? 'a' : s[i] + 1;
            }
            if( s.find( "the" ) != string::npos || s.find( "this" ) != string::npos || s.find( "that" ) != string::npos){
                cout << s << endl;
            }
        }
    }
}

C++: #include <stdio.h>

int str_len(char str[128]) {
	int i = 0;

	while(str[i]) i++;

	return i;
}

/* 二つの文字列が一致すれば1,一致しなければ0をかえす */
int str_comp(char str1[128], char str2[128]) {
	int len;
	int i;

	/* 文字列の長さが一致しなかった場合 */
	if((len = str_len(str1)) != str_len(str2))
		return 0;

	for(i = 0; i < len; i++) {
		if(str1[i] != str2[i])
			return 0;
	}

	return 1;
}

/* char1からchar2への準方向への差を求める */
int deff_two_char(char char1, char char2) {
	int ans;
	if((ans = char2 - char1) < 0)
		ans += 26;

	return ans;
}

/* 文字を順方向へdeffだけずらす */
char shift_letter_deff(int deff, char c) {
	char ans = c;

	if(c - 'a' + deff > 25)
		ans += deff - 26;
	else
		ans += deff;
	
	return ans;
}

/* 単語を準方向へdeffだけずらす */
void shift_deff(int deff, char str[128]) {
	int i = 0;

	while(str[i]) {
		str[i] = shift_letter_deff(deff, str[i]);
		i++;
	}
}

/* 文字列をコピー */
void str_cp(char str1[128], char str2[128]) {
	int i = 0;

	while(str1[i]) {
		str2[i] = str1[i];
		i++;
	}

	str2[i] = '\0';
}

int main() {
	/* 使用する変数の宣言 */
	char input_str[128];
	char dev_word_str[41][80];

	int deff;
	int deff_the = -1;
	int deff_that = -1;
	int deff_this = -1;
	int count_the = 0;
	int count_that = 0;
	int count_this = 0;
	int temp_deff;

	char temp[80];

	int word_sum;
	int letter_sum[40];

	int i, j, k;

	/* 入力を受け取る */
	while(fgets(input_str, 128, stdin) != NULL) {
		/* 各変数の初期化 */
		deff_the = -1;
		deff_that = -1;
		deff_this = -1;
		count_the = 0;
		count_that = 0;
		count_this = 0;

		/* 入力された文字列を単語ごとに分ける */
		i = 0; j = 0; k = 0;
		while(input_str[i]) {
			if(input_str[i] == ' ') {
				dev_word_str[j][k] = '\0';
				letter_sum[j] = k;
				j++;
				k = 0;
			}
			else if(input_str[i] == '.')
				dev_word_str[j][k] = '\0';
			else {
				dev_word_str[j][k] = input_str[i];
				k++;
			}

			i++;
		}

		word_sum = j + 1;

		/* 文字列を比較して、the, that, thisのいずれかがあるか調べる。 */
		for(i = 0; i < word_sum; i++) {
			str_cp(dev_word_str[i], temp);
			temp_deff = deff_two_char(temp[0], 't');
			shift_deff(temp_deff, temp);
			if(str_comp("the", temp)) {
				if(!count_the || deff_the != temp_deff) {
					deff_the = temp_deff;
					count_the++;
				}
			}
			else if(str_comp("that", temp)) {
				if(!count_that || deff_that != temp_deff) {
					deff_that = temp_deff;
					count_that++;
				}
			}
			else if(str_comp("this", temp)) {
				if(!count_this || deff_this != temp_deff) {
					deff_this = temp_deff;
					count_this++;
				}
			}
		}

		/* 比較の結果をもとに、実際いくつずれているか調べる。 */
		if(count_the == 1)
			deff = deff_the;
		else if(count_that == 1)
			deff = deff_that;
		else
			deff = deff_this;
		
		/* 出力 */
		i = 0;
		while(input_str[i]) {
			if(input_str[i] == ' ')
				putchar(' ');
			else if(input_str[i] == '.')
				putchar('.');
			else
				printf("%c", shift_letter_deff(deff, input_str[i]));
			i++;
		}

		putchar('\n');
	}

	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <list>
#include <algorithm>
#include <cmath>
#include <stack>
#include <set>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define FOR(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define PUSH(n,v) for(int i=0; i<(n); i++) {int j; cin >> j; v.push_back(j);}
#define ALL(v) v.begin(), v.end()

void rot1(string &s) {
    string t = "";
    REP(i,s.size()) {
        if (s[i] > 'a' && s[i] < 'z') {
            if (s[i] == 'a') t += "z";
            else t += s[i] - 1;
        }else {
            t += s[i];
        }
    }
    s = t;
}

int main() {
    string s;
    getline(cin, s);
    while(s.find("the") == string::npos && s.find("this") == string::npos && s.find("that") == string::npos) {
        rot1(s);
    }
    cout << s << endl;
    return 0;
}