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<bits/stdc++.h>
#include<sstream>
using namespace std;

typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pair<int, int> > vii;
#define rrep(i, m, n) for(int (i)=(m); (i)<(n);  (i)++)
#define erep(i, m, n) for(int (i)=(m); (i)<=(n); (i)++)
#define  rep(i, n)    for(int (i)=0; (i)<(n);  (i)++)
#define rrev(i, m, n) for(int (i)=(n)-1; (i)>=(m); (i)--)
#define erev(i, m, n) for(int (i)=(n); (i)>=(m); (i)--)
#define  rev(i, n)    for(int (i)=(n)-1; (i)>=0; (i)--)
#define vrep(i, c)    for(__typeof((c).begin())i=(c).begin(); i!=(c).end(); i++)
#define  ALL(v)       (v).begin(), (v).end()
#define mp            make_pair
#define pb            push_back
template<class T, class S> inline bool minup(T& m, S x){ return m>(T)x ? (m=(T)x, true) : false; }
template<class T, class S> inline bool maxup(T& m, S x){ return m<(T)x ? (m=(T)x, true) : false; }

const int    INF = 1000000000;
const ll     MOD = 1000000007LL;
const double EPS = 1E-12;

template<typename T> ostream& operator << (ostream& r, const vector<T> t){vrep(v,t)r<<*v<<(v+1==t.end()?"":" ");return r;}
template<typename T> ostream& operator << (ostream& r, const pair<vector<T>, int> p){int n=p.second;minup(n,p.first.size());rep(i,n-1)r<<p.first[i]<<' ';r<<p.first[n-1];return r;}
template<typename T> ostream& operator << (ostream& r, const pair<T*, int> p){int n=p.second-1;rep(i,n)r<<p.first[i]<<' ';return r<<p.first[n];}
template<typename T, size_t S> ostream& operator << (ostream& r, const T (&a)[S]){rep(i,S-1)r<<a[i]<<' ';return r<<a[S-1];}

string str;
vector<string> res;

int main()
{
  while(cin >> str) res.pb(str);

  bool ok = false;
  rep(k, 26){
    vrep(v, res) rep(i, v->size()) if((*v)[i] >= 'a' && (*v)[i] <= 'z') (*v)[i] = 'a' + ((*v)[i] + 1) % 26;
    vrep(v, res) if(*v == "the" || *v == "this" || *v == "that") ok = true;
    if(ok){
      cout << res << endl;
      break;
    }
  }

  /*
  while(getline(cin, str)){
    vector<string> s;
    istringstream stream(str);
    while(getline(stream, str, ' ')) s.pb(str);
    bool ok = false;
    rep(k, 26){
      vrep(v, s) rep(i, v->size()) if((*v)[i] >= 'A' && (*v)[i] <= 'z') (*v)[i] = 'a' + ((*v)[i] + 1) % 26;
      vrep(v, s) if(*v == "the" || *v == "this" || *v == "that") ok = true;
      if(ok){
        cout << s << endl;
        break;
      }
    }
  }
  */

  return 0;
}

C++: #include<iostream>
#include<string>
#define num 27
using namespace std;

int main(){
	int i;
	string str;
	getline(cin, str);
	string strcp = str;
	string::iterator si;
	for(i=0;i<num;i++){
		if(  strcp.find("this") != string::npos
		  || strcp.find("that") != string::npos
		  || strcp.find("the" ) != string::npos){
			cout << strcp << endl;
		}
		si = strcp.begin();
		while(si != strcp.end()){
			if('a' <= *si && *si <= 'y'){
				*si = *si + 1;
			}else if(*si == 'z'){
				*si = 'a';
			}
			si++;
		}
	}
	return 0;
}

C++: #include<stdio.h>
#include<string.h>
#include<math.h>
#include<iostream>
#include<algorithm>
#include<set>
#include<queue>
#include<string>
#include<vector>
#include<map>
#include<stack>
#include<list>
using namespace std;
#define inf 0x3f3f3f3f

char d[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 s[110000];
char t[110000];
int main(){
	
	char c;
	int i=0;
	while(c=getchar()){
		if(c==EOF){
			s[i]='\0';
			break;
		}
		s[i++] = c;
	}
	int l = strlen(s),j,k,m;
	for(i=0;i<=26;i++){
		for(j=0;j<l-1;j++){
			if(s[j]>='a'&&s[j]<='z'){
				t[j] = d[(s[j]-'a'+i)%26];
			}
			else t[j] =s[j];
		}
		int a=0,b=0,c=0;
		for(j=0;j<l-3;j++){
			if(t[j]=='t'&&t[j+1]=='h'){
				if(t[j+2]=='e'&&!(t[j+3]>='a' && t[j+3]<='z')){
					a++;
				}
				if(t[j+2]=='i'&&t[j+3]=='s'&&!(t[j+4]>='a'&&t[j+4]<='z')){
					b++;
				}
				if(t[j+2]=='a'&&t[j+3]=='t'&&!(t[j+4]>='a'&&t[j+4]<='z')){
					c++;
				}
			}
		}
		if(a||b||c)break;
	}
	for(j=0;j<l-1;j++){
		if(s[j]>='a'&&s[j]<='z'){
			printf("%c",d[(s[j]-'a'+i)%26]);
		}
		else printf("%c",s[j]);
	}
	puts("");
	return 0;
}

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

int main() {
	char s[100] = {};
	while (fgets(s,sizeof(s),stdin)) {
		int start = 0, ofs=0,ofs2,chk=1;
		int buf;
		for (int i = 0; s[i] != '\n'; i++) {
			if (s[i] == ' ' || s[i] == '.') {
				if (i - start == 3) {
					chk = 1;
					ofs2 = (int)'t' - (int)(s[start]);
					for (int j = 1; j < 3; j++) {
						buf = (int)s[start + j] + ofs2;
						if (buf > (int)'z')
							buf -= 26;
						if (buf < (int)'a')
							buf += 26;
						if (j == 1 && buf != (int)'h') {
							chk = 0;
							break;
						}
						if (j == 2 && buf != (int)'e')
							chk = 0;
					}
					if (chk == 1) {
						ofs = ofs2;
						break;
					}
				}
				if (i - start == 4){
					chk = 1	;
					ofs2 = (int)'t' - (int)s[start];
					for (int j = 1; j < 4; j++) {
						buf = (int)s[start + j] + ofs2;
						if (buf > (int)'z')
							buf -= 26;
						if (buf < (int)'a')
							buf += 26;
						if (j == 1 && buf != (int)'h') {
							chk = 0;
							break;
						}
						if (j == 2 && buf == (int)'a')
							chk = 2;
						if (j == 2 && buf == (int)'i')
							chk = 3;
						if (j == 2 && buf != (int)'i'&&buf != (int)'a') {
							chk = 0;
							break;
						}
						if (j == 3 && chk == 2) {
							if (buf == (int)'t')
								chk = 1;
							else {
								chk = 0;
								break;
							}
						}
						if (j == 3 && chk == 3) {
							if (buf == (int)'s')
								chk = 1;
							else {
								chk = 0;
								break;
							}
						}
					}
					if (chk == 1) {
						ofs = ofs2;
						break;
					}
				}
				start = i + 1;
			}
		}
		for (int i = 0; s[i] != '\n'; i++) {
			int buf;
			if (s[i] != ' '&& s[i]!='.') {
				buf = (int)s[i] + (int)ofs;
				if (buf > (int)'z')
					buf -= 26;
				if (buf < (int)'a')
					buf += 26;
				s[i]=(char)buf;
			}
		}
		cout << s;
	}
	return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;

int main(){

	string code;
	string word;
	bool found;

	while( getline(cin, code) ){
		found = false;

		for( int j=0;j<25;j++ ){


			for( int i=0;i<code.length();i++ ){
				if( code[i] >= 'a' && code[i] <= 'z' ){
					code[i] += 1;
					if(code[i]=='z'+1)code[i]='a';
				}
			}


			word = "";
			for( int i=0;i<code.length()+1;i++){
				if(code[i] >= 'a' && code[i] <= 'z' )
					word += code[i];
				else{
					if( word == "the" || word == "this" || word == "that" ){
						found = true;
					}
					word = "";
				}
				
			}
			if(found)break;
			
			
		
		}
		cout << code << " " << endl;

	}
	return 0;

}