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<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 <string.h>

int
main(void)
{
	char line[100];
	char res[100];

	auto chksep = [](char c) -> bool {
			return (c == ' ' || c == '.' || c == '\n');
		};

	while (fgets(line, sizeof line, stdin)) {
		int len = strlen(line);
		int state = 0;
		
		for (int s = 0; s < 26; s++) {

			for (int i = 0; i < len; i++) {
				if (chksep(line[i])) {
					res[i] = line[i];
				} else {
					int c = line[i] + s;
;					if (c > 'z') {
						res[i] = c - 'z' + 'a' - 1;
					} else {
						res[i] = c;
					}
				}

				switch (state) {
				case 0:
					if (res[i] == 't') {
						state = 1;
					}
					break;

				case 1:
					if (res[i] == 'h') {
						state = 2;
					} else {
						state = 0;
					}
					break;

				case 2:
					if (res[i] == 'e') {
						state = 5;
					} else if (res[i] == 'i') {
						state = 3;
					} else if (res[i] == 'a') {
						state = 4;
					} else {
						state = 0;
					}
					break;

				case 3:
					if (res[i] == 's') {
						state = 5;
					} else {
						state = 0;
					}
					break;

				case 4:
					if (res[i] == 't') {
						state = 5;
					} else {
						state = 0;
					}
					break;

				case 5:
					if (chksep(res[i])) {
						state = 99;
					} else {
						state = 0;
					}
					break;
				}
			}

			if (state == 99) {
				res[len] = 0;
				printf("%s", res);
				break;
			}
		}
	}

	return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iostream>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <numeric>
#include <algorithm>
#include <bitset>
#include <complex>
#include <fstream>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T> T RoundOff(T a){ return int(a+.5-(a<0)); }
template<class T, class C> void chmax(T& a, C b){ if(a < b) a = b; }
template<class T, class C> void chmin(T& a, C b){ if(b < a) a = b; }
template<class T, class C> pair<T, C> mp(T a, C b){ return make_pair(a, b); }


int main()
{
	string str;
	getline(cin, str);

	rep(i, 26)
	{
		rep(j, str.size())
			if(str[j] != ' ' && str[j] != '.')
				str[j] = (++str[j] > 'z' ? 'a' : str[j]);
		
		if(str.find("the") != string::npos || str.find("this") != string::npos || str.find("that") != string::npos)
		{
			cout << str << endl;
			break;
		}
	}
}

C++: #include<iostream>
#include<cstring>
#include<sstream>
using namespace std;
/*
string text = "hello world";
stringstream ss(text);
string t;
while (ss >> t){
*/
void fin(string a)
{
	cout << a << endl;
	return;
}
int main()
{
	string a,b;
	bool fir=false;
	while (cin >> b)
	{
		if(fir)a.append(" ");
		a.append(b);
		fir = true;
	}
	cout << a;
	while (1)
	{
		if (a.find("the", 0) != string::npos)
		{
			fin(a); return 0;
		}
		if (a.find("this", 0) != string::npos)
		{
			fin(a); return 0;
		}
		if (a.find("that", 0) != string::npos)
		{
			fin(a); return 0;
		}
		for (int i = 0; i < a.size()-1; i++)
		{
			if (a[i] != ' ')a[i] += 1;
			if (a[i]>'z')a[i] = 'a';
		}
	}
	

}

C++: #include <iostream>
#include <string>
using namespace std;
int main(){
	string s;
	while(getline(cin,s)){
		for(int i=1;i<26;++i){
			for(int j=0;j<s.size();++j) if('a'<=s[j]&&s[j]<='z') s[j]=((s[j]-'a'+1)%26+'a');
			if(s.find("the")!=-1||s.find("this")!=-1||s.find("that")!=-1)break;
		}
		cout<<s<<endl;
	}
	return 0;
}

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

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

C++: #include <bits/stdc++.h>
 
using namespace std;
 
#define FOR(i, j, k) for(int i = j; i < k; ++i)
#define rep(i, j) FOR(i, 0, j)
#define repr(i, j) for(int i = j; i >= 0; --i)
#define INF (1 << 30)
#define MOD 1e9 + 7
 
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
 
int main() {
    string s;
    string ans;
    bool flag = false;
    int key = 1;
    while(getline(cin, s)){
    	while(s != "the" && s != "that" && s != "this") {
	    	rep(i, s.size()) {
	            if(97 <= s[i] && s[i] <= 122) {
	                int number = (s[i] - 'a' + key) % 26;
	                s[i] = 'a' + number;
	            }
	        }
	    }
	    cout << ans << endl;
    }
    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 == "") break;
        while (s.find("the") != string::npos && s.find("this") != string::npos && s.find("that") && string::npos) f(s);
        cout << s << endl;
    }
}