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 <vector>
using namespace std;
typedef pair<int,char*> str;

int main(void){
	char s[81];
	vector<str> v;
	const char* cmp1="that";
	const char* cmp2="this";
	const char* cmp3="the";
	bool is_found=false;
	int pos=0,end_pos,diff;
	char c;

	scanf("%[^\n]",s);
	for(int i=0;i<81;i++){
		if(s[i]==' ' || s[i]=='.'){
			c=s[i];
			s[i]='\0';
			v.push_back(str(i-1-pos,s+pos));
			s[i]=c;
			pos=i+1;
		}else if(s[i]=='\0'){
			end_pos=i;
			break;
		}
	}

	for(int i=0;i<v.size();i++){
		is_found=false;

		diff=1000;
		if(v[i].first==4){
			for(int j=0;j<4;j++){
				if(diff==1000){
					diff=v[i].second[j]-cmp1[j];
				}else if(diff!=v[i].second[j]-cmp1[j]){
					is_found=true;
					break;
				}
			}

			if(!is_found) break;

			diff=1000;
			for(int j=0;j<4 && !is_found;j++){
				if(diff==1000){
					diff=v[i].second[j]-cmp2[j];
				}else if(diff!=v[i].second[j]-cmp2[j]){
					is_found=true;
					break;
				}
			}

			if(!is_found) break;
		}else if(v[i].first==3){
			diff=1000;
			for(int j=0;j<3;j++){
				if(diff==1000){
					diff=v[i].second[j]-cmp2[j];
				}else if(diff!=v[i].second[j]-cmp2[j]){
					is_found=true;
					break;
				}
			}
			if(!is_found) break;
		}
	}
	
	for(int i=0;i<end_pos;i++){
		if(s[i]!=' ' && s[i]!='.'){
			s[i]-=diff;
		}
	}

	printf("%s\n",s);


	return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

void f(string &s)
{
    for (char &c : s) {
        if ('a' <= c && c <= 'z') c = (c - 'a' + 25) % 26 + 'a';
    }
}

int main()
{
    string s;

    while (getline(cin, s)) {
        if (s.empty()) break;
        while (s.find("the") == string::npos && s.find("this") == string::npos && s.find("that") == string::npos) f(s);
        cout << s << endl;
    }
}

C++: #define scanf_s scanf
#define gets_s gets
#include <stdio.h>
#include <string>
#include <iostream>
#include <math.h>
using namespace std;
#define MAX 81
#define _MAX 100
#define ABC 26
int main(void)
{
	int n, s = 0, x, y, r = 0, a, b;
	int sum_n[50][3] = { 0 };
	char sum[50][_MAX], str[_MAX], bstr[_MAX], num[11] = { "0123456789" };
	//
	while(gets_s(str) != NULL){
		for (int i = 0; str[i] != '\0'; ++i) {
			if (str[i] - 't' == str[i + 1] - 'h') {
				a = str[i] - 't';
				if ((str[i + 2] - a + 'z') % 'z' == 'e') { b = a; break; }
				else if ((str[i + 2] - a + 'z') % 'z' == 'i' + ABC && (str[i + 3] - a + 'z') % 'z' == 's') { b = a; break; }
				else if ((str[i + 2] - a + 'z') % 'z' == 'a' + ABC && (str[i + 3] - a + 'z') % 'z' == 't') { b = a; break; }
			}
		}
		for (int i = 0; str[i] != '\0'; ++i) {
			if ('a' <= str[i] && str[i] <= 'z') {
				printf("%c", (str[i] - a + 'z') % 'z');
			}
			else { printf("%c", str[i]); }
		}
		printf("\n");
	}
}

C++: #include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
#include <string>
#include <functional>
#include <array>
#include <stack>
#include <queue>
#include <chrono>
#include <numeric>
#include <memory.h>
#include <map>
#include <math.h>
#include <utility>
#include <set>

#pragma warning(disable:4996)
using namespace std;
#define REP(i,n) for(int i = 0 ; i < n ; ++i)
typedef long long Int;
const double PI = 3.141592653589793238;
const Int INF = 999999999999;
typedef pair<int, int> P;

vector<string> aa;

int main()
{
	string a;

	getline(cin, a);
	auto left = a.begin();
	
	while (true){
		auto right = left;
		while (right != a.end() && *right != ' ')++right;

		aa.emplace_back(left,right);
		if (right == a.end())
			break;

		left = right+1;
	}
	

	string c[3] = { "this", "that" , "the"};

	vector<string> nn;
	vector<string> kk;
	for (auto x : aa){
		auto n = x.length();
		if (n == 3){
			kk.push_back(x);
		}
		if (n == 4){
			nn.push_back(x);
		}
	}

	for (auto x : kk){
		auto n1 = x[0] - c[2][0];
		bool f(true);

		for (int i = 1; i < 3; ++i){
			if (n1 != x[i] - c[2][i])
				f = false;
		}

		if (f){
			int i(0);
			for (auto x : aa){
				for (auto y : x){
					if (y == '.'){
						std::cout << y;
						continue;
					}

					int q = y - 'a';
					if (q - n1 < 0){
						q = 26 - n1;
					}
					else
						q -= n1;

					std::cout << (char)(q + 'a');
				}
				if (i < aa.size() - 1)
					std::cout << " ";
				++i;
			}
			std::cout << endl;
			return 0;
		}
	}

	for (auto x : nn){
		auto n1 = x[0] - c[0][0];
		auto n2 = x[0] - c[1][0];
		bool f(true);
		bool f2(true);

		for (int i = 1; i < 4; ++i){
			if (n1 != x[i] - c[0][i])
				f = false;
			if (n2 != x[i] - c[1][i])
				f2 = false;
		}

		if (f){
			int i(0);
			for(auto x : aa){
				for (auto y : x){
					if (y == '.'){
						std::cout << y;
						continue;
					}

					int q = y - 'a';
					if (q - n1 < 0){
						q = 26 - n1;
					}
					else
						q -= n1;

					std::cout << (char)(q + 'a');
				}
				if (i < aa.size()-1)
					std::cout << " ";
				++i;
			}
			std::cout << endl;
			return 0;
		}
		else if (f2){
			int i(0);
			for (auto x : aa){
				for (auto y : x){
					if (y == '.'){
						std::cout << y;
						continue;
					}

					int q = y - 'a';
					if (q - n2 < 0){
						q = 26 - n2;
					}
					else
						q -= n2;

					std::cout << (char)(q + 'a');
				}
				if (i < aa.size() - 1)
					std::cout << " ";
				++i;
			}
			std::cout << endl;
			return 0;
		}

	}
	return 0;
}