Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	for scanner.Scan() {
		var result string
		line := scanner.Text()
		key := make(map[string]string)

		var i int32
		for ; i < 52; i++ {
			makeKey(key, i)
			result = decode(key, line)

			if strings.Contains(result, "the") {
				break
			} else if strings.Contains(result, "this") {
				break
			} else if strings.Contains(result, "that") {
				break
			}
		}

		fmt.Println(result)
	}
}

func makeKey(key map[string]string, shift int32) {
	for i := 'a'; i <= 'z'; i++ {
		cipher := (i + shift)
		if cipher > 'z' {
			cipher = cipher%'z' + 'a' - 1
		} else if cipher < 'a' {
			cipher = cipher + ('z' - 'a') + 1
		}
		key[string(i)] = string(cipher)
	}
}

func decode(key map[string]string, cipher string) string {
	var result string
	for _, v := range cipher {
		if key[string(v)] != "" {
			result += key[string(v)]
		} else {
			result += string(v)
		}
	}
	return result
}

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

using namespace std;

bool includes_keyword(const char *str) {
  const static char *keywords[] = { "the", "this", "that" };
  for (const auto keyword : keywords) {
    const char *pos = strstr(str, keyword);
    if (pos == NULL) { continue; }
    if (pos != str && isalpha(pos[-1])) { continue; }
    if (isalpha(pos[strlen(keyword)])) { continue; }
    return true;
  }
  return false;
}

int main() {
  while (!feof(stdin)) {
    char cipher[81];
    fgets(cipher, 81, stdin);

    size_t len = strlen(cipher);
    if (cipher[len - 1] == '\n') { cipher[len - 1] = '\0'; }

    char c = 'z';
    for (int i = 0; i < len; ++i) {
      if (isalpha(cipher[i]) && c > cipher[i]) { c = cipher[i]; }
    }
    int shift_begin = 'a' - c;
    int shift_end = shift_begin + 26;
    char decoded[81];
    for (int shift = shift_begin; shift < shift_end; ++shift) {
      strcpy(decoded, cipher);
      for (int i = 0; i < len; ++i) {
        if (isalpha(decoded[i])) { decoded[i] += shift; }
      }
      if (includes_keyword(decoded)) { break; }
    }

    puts(decoded);
  }

  return 0;
}

C++: #include <iostream>
#include <string>
#include <stdio.h>

#define NUM_OF_ALPHABET ('z' - 'a' + 1)

bool isValidResult(const std::string str);
bool decodeStr(const std::string srcStr, std::string& dstStr, int decodeNum);

int main(void)
{
	std::string inputStr;
	std::string outputStr;

	char line[100];
	fgets(line, sizeof(line), stdin);
	inputStr = line;

	for (int i = 0; i < NUM_OF_ALPHABET; i++) {
		if (decodeStr(inputStr, outputStr, i)) {
			std::cout << outputStr;
			break;
		}
		outputStr.clear();
	}
	return 0;
}

bool isValidResult(const std::string str)
{
	if (str.find(" the") != std::string::npos || str.find(" this") != std::string::npos || str.find(" that") != std::string::npos ||
		str.find("the ") != std::string::npos || str.find("this ") != std::string::npos || str.find("that ") != std::string::npos ||
		str.find("the")  != std::string::npos || str.find("this")  != std::string::npos || str.find("that")  != std::string::npos) {
		return true;
	}
	else {
		return false;
	}
}

bool decodeStr(const std::string srcStr, std::string& dstStr, int decodeNum)
{
	for (int i = 0; i < srcStr.size(); i++) {
		if (srcStr.at(i) >= 'a' && srcStr.at(i) <= 'z') {
			unsigned char tmpChar;
			tmpChar = srcStr.at(i) + decodeNum;
			if (tmpChar > 'z') {
				tmpChar -= NUM_OF_ALPHABET;
			}
			dstStr.push_back(tmpChar);
		}
		else {
			dstStr.push_back(srcStr.at(i));
		}
	}
	if (isValidResult(dstStr)) {
		return true;
	}
	else {
		return false;
	}
}

C++: #include <bits/stdc++.h>
using namespace std;

//#define int long long
#define reps(i,s,n) for(int (i)=(s);(i)<(n);++(i))
#define rep(i,n) reps(i,0,n)
#define rept(i,n) rep(i,(n)+1)
#define repst(i,s,n) reps(i,s,(n)+1)
#define reprt(i,n,t) for(int (i)=(n);(i)>=(t);--(i))
#define repr(i,n) reprt(i,n,0)
#define each(itr,v) for(auto &(itr):(v))
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define tmax(x,y,z) max(x,max(y,z))
#define tmin(x,y,z) min(x,min(y,z))
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define ln '\n'
#define bln(i,n) (((i)==(n)-1)?'\n':' ')
#define dbg(x) cout<<#x" = "<<(x)<<ln<<flush
#define dbga(x,n) {cout<<#x" : ";for(int (i)=0;i<(n);++i){cout<<((x)[i])<<(i==((n)-1)?'\n':' ')<<flush;}}
#define zero(a) memset(a,0,sizeof(a))
#define unq(a) sort(all(a)),a.erase(unique(all(a)),a.end())

typedef complex<double> P;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<string> vst;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<vector<int> > mat;

const ll inf = (ll)1e9+10;
const ll linf = (ll)1e18+10;
const ll mod = (ll)(1e9+7);
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};
const double eps = 1e-10;

ll mop(ll a,ll b,ll m=mod) {ll r=1;a%=m;for(;b;b>>=1){if(b&1)r=r*a%m;a=a*a%m;}return r;}
ll gcd(ll a,ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b) {return a*b/gcd(a,b);}
bool ool(int x,int y,int h,int w) {return((x<0)||(h<=x)||(y<0)||(w<=y));}
bool deq(double a,double b) {return abs(a-b)<eps;}

struct oreno_initializer {
	oreno_initializer() {
		cin.tie(0);
		ios::sync_with_stdio(0);
	}
} oreno_initializer;

// ━━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…
// .｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋
// ・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・

typedef string::const_iterator S;
string s;

bool ok(S &i, S &e) {
	if (i==e) return 0;
	string t;
	while (*i!=' ') t.pb(*i), i++;
	if ((t.size()>=3 && t.substr(0,3)=="the") || (t.size()>=4 && (t.substr(0,4)=="that" || t.substr(0,4)=="this"))) return 1;
	return ok(++i,e);
}

signed main() {
	getline(cin,s);
	s.pb(' ');
	rep(i,26) {
		S b = s.begin(), c = s.end();
		if (ok(b,c)) return cout << s << ln, 0;
		rep(j,s.size()) if ('a'<=s[j] && s[j]<='z') {
			s[j]++;
			if (s[j]>'z') s[j] = 'a';
		}
	}
}

C++: #include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <cmath>
using namespace std;

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define llong long long

int main() {
  char *a = (char*)malloc(sizeof(char)*82);
  size_t l = 0;
  while (getline(&a, &l, stdin) != EOF) {
    while(1) {
      int q = 0;//1..t, 2..th, 3..the, 4...thi, 5..this, 6..tha, 7..that 
      REP(j , (int)l) {
	if(a[j] == 'z') a[j] = 'a';
	else if(a[j] >= 'a' && a[j] < 'z') a[j]++;
      }
      REP(j , (int)l) {
	switch(q){
	case 0:
	  if(a[j] == 't') q++;
	  break;
	case 1:
	  if(a[j] == 'h') q++;
	  else q = 0;
	  break;
	case 2:
	  if(a[j] == 'e') q = 3;
	  else if(a[j] == 'i') q = 4;
	  else if(a[j] == 'a') q = 6;
	  else q = 0;
	  break;
	case 4:
	  if(a[j] == 's') q = 5;
	  else q = 0;
	  break;
	case 6:
	  if(a[j] == 't') q = 7;
	  else q = 0;
	  break;
	}
      }
      if(q == 3 || q == 5 || q == 7) break;
    }
    
    REP(i , (int)l) {
      printf("%c",a[i]);
    }
  }
  return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
int main() {
  string line;
  while (getline(cin, line)) {
    while (line.find("the") == string::npos && line.find("this") == string::npos
      && line.find("that") == string::npos)
      for (auto& c : line)
        if (c == 'a') c = 'z';
        else if (c != '.' && c != ' ') c -= 1;
    cout << line << endl;
  }
}