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 <fstream>
#include <iostream>
#include <cmath>
#include <vector>
#include <queue>
#include <utility>
#include <algorithm>
using namespace std;

char shift(char c, int n) {
  if (c >= 'a' && c <= 'z')
    return (c + n <= 'z') ? c + n : 'a' + (c + n - 'z' - 1);
  else
    return c;
}

bool exist(string str, string c) {
  return str.find(c, 0) != string::npos;
}

int main() {
  // ifstream cin("../test.txt");
  vector<string> _the(26);
  vector<string> _this(26);
  vector<string> _that(26);
  _the[0] = "the";
  _this[0] = "this";
  _that[0] = "that";
  for (int i = 1; i < 26; i++) {
    for (int j = 0; j < 3; j++) {
      _the[i] += shift(_the[0][j], i);
    }
    for (int j = 0; j < 4; j++) {
      _this[i] += shift(_this[0][j], i);
      _that[i] += shift(_that[0][j], i);
    }
  }

  string str, nstr;
  // 復号化
  while (getline(cin, str)) {
    if (str.length() == 0) break;
    nstr = "";
    for (int i = 1; i < 26; i++) {
      if ( exist(str, _the[i]) || exist(str, _this[i]) || exist(str, _that[i])) {
        int len = str.length();
        for (int j = 0; j < len; j++) {
          nstr += shift(str.at(j), 26 - i);
        }
        break;
      }
    }

    cout << nstr << endl;
  }
  // 暗号化
  // while (getline(cin, str)) {
  //   for (int i = 1; i < 26; i++) {
  //     nstr = "";
  //     int len = str.length();
  //     for (int j = 0; j < len; j++) {
  //       nstr += shift(str[j], i);
  //     }
  //     cout << nstr << endl;
  //   }
  // }
}

C++: #include<bits/stdc++.h>
using namespace std;
void Caesarcipher(string &s,int c){
  if(c<0) c = 26+c%26;
  else c %= 26;
  for(int i=0;i<s.size();i++){
    if('a' <= s[i] && s[i] <= 'z'){
      s[i] += c;
      if(s[i] > 'z') s[i] -= 26;
      else if(s[i] < 'a') s[i] += 26;
    }
  }
}
int main(){
  string s;int i;
  while(getline(cin,s)){
    for(i=0;i<26;i++){
      Caesarcipher(s,1);
      if(s.find("the") != string::npos || s.find("this") != string::npos || s.find("that") != string::npos){
        cout << s << "\n";
      }
    }
  }
}

C++: #include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define NCLR(a) memset((a), -1 ,sizeof(a))
#define dump(x) cout << #x << " = " << (x) << "\n";
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n";
#define sq(n) (n) * (n)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
typedef complex<double> P;
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 1000000007;
static const int INF = 1 << 30;
static const LL LL_INF = 1152921504606846976;
static const int dx[] = { -1, 0, 1, 0, 1, -1, 1, -1 };
static const int dy[] = { 0, -1, 0, 1, 1, 1, -1, -1 };

string str;
map<char, char> change;

int main() {
	for ( int i = 0; i < 26; i++ ) {
		change[ i + 'a' ] = ( i + 25 ) % 26 + 'a';
	}
	while ( getline( cin, str ) ) {
		for ( ;; ) {
			for ( int j = 0; j < str.size(); j++ ) {
				if ( str[ j ] >= 'a' && str[ j ] <= 'z' ) {
					str[ j ] = change[ str[ j ] ];
				}
			}
			bool is_can = false;
			for ( int j = 2; j < str.size(); j++ ) {
				if ( str.substr( j - 2, 3 ) == "the" ) {
					is_can = true;
					break;
				}
			}
			for ( int j = 3; j < str.size(); j++ ) {
				if ( str.substr( j - 3, 4 ) == "that" || str.substr( j - 3, 4 ) == "this" ) {
					is_can = true;
					break;
				}
			}
			if ( is_can ) {
				break;
			}

		}
		printf( "%s\n", str.c_str() );
	}
	return 0;
}

C++: #include<stdio.h>
#include<string.h>
int main(void){
    int i,j,k;
    char input[100],cpyinput[100],key[3][5]={"the","this","that"};
    while(gets(input)!=NULL){
        for(i=0;i<26;i++){
            for(j=0;j<strlen(input);j++){
                if('a'<=input[j] && input[j]<='z'){
                    input[j]+=1;
                    if(input[j]>'z')
                        input[j]-=26;
                }
                //printf("%c",input[j]);
            }
            //puts("");
            //printf("%s\n",input);
            //puts("test");
            for(j=0;j<3;j++){
                if(strstr(input,key[j])!=NULL){
                    //printf("test");
                    goto next;
                }
            }
        }
        next:
        printf("%s\n",input);
    }
    return 0;
}

C++: #include<iostream>
using namespace std;
bool isAlpha(char ch){
  return ('a'<=ch&&ch<='z');
}
string change(string str){
  for(int i=0;i<(int)str.size();i++){
    if(isAlpha(str[i])){
      if(str[i]=='z')str[i]='a';
      else str[i]++;
    }
  }
  return str;
}
int main(){
  int i,j;
  string str;
  
  getline(cin,str);
  for(i=0;i<26;i++){
    str=change(str);
    for(j=0;j+3<(int)str.size();j++)
      if(str.substr(j,3)=="the")break;
    for(j=0;j+4<(int)str.size();j++)
      if(str.substr(j,4)=="this")break;
    for(j=0;j+4<(int)str.size();j++)
      if(str.substr(j,4)=="that")break;
  }
  cout<<str<<endl;

  
  return 0;
}