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 <iostream>
#include <string>

int search_number(const std::string &s)
{
    const char *key = "this";
    std::string::size_type p = 0;
    while (true) {
        std::string::size_type sp = s.find(' ', p);
        if (sp - p == 4) {
            int n = s[p] - key[0];
            if (s[p + 1] - key[1] == n && s[p + 2] - key[2] == n && s[p + 3] - key[3] == n) return n;
            else p = sp + 1;
        }
    }
}

int main()
{
    std::string s;
    while (getline(std::cin, s)) {
        std::cout << s << std::endl;
        int n = search_number(s);
        for (unsigned i = 0; i < s.size(); ++i) {
            if (s[i] != ' ' && s[i] != ',' && s[i] != '.') {
                s[i] -= n;
                if (s[i] < 'a') s[i] += 26;
                if (s[i] > 'z') s[i] %= 26;
            }
        }
        std::cout << s << std::endl;
    }
}

C++: #include <iostream>
#include <sstream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
#include <cstdio>
#include <cmath>
using namespace std;

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
#define ALL(a)  (a).begin(),(a).end()
#define REP(i,n) for(int i=0;i<(n);++i)
const double EPS = 1e-10;
const double PI  = acos(-1.0);
#define dump(x) cerr << "  (L" << __LINE__ << ") " << #x << " = " << (x) << endl;
#define dumpv(x) cerr << "  (L" << __LINE__ << ") " << #x << " = "; REP(q,(x).size()) cerr << (x)[q] << " "; cerr << endl;
template<typename T1, typename T2>
ostream& operator<<(ostream& s, const pair<T1, T2>& d) {return s << "(" << d.first << "," << d.second << ")";}


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

  string orig;
  for (int i = 1; i <= 'z'-'a'; i++) {
    orig = s;
    for (int j = 0; j < orig.size(); j++) {
      if (orig[j] >= 'a' && orig[j] <= 'z') {
        orig[j] = 'a' + ((orig[j]-'a') + i) % ('z'-'a'+1);
      }
    }
    if (orig.find("the") != string::npos ||
        orig.find("this") != string::npos ||
        orig.find("that") != string::npos) {
      break;
    }
  }
  cout << orig << endl;
}

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

#define pb(n) push_back(n)
#define fi first
#define se second
#define np string::npos
#define X real()
#define Y imag()
#define value(x,y,w,h) (x >= 0 && x < w && y >= 0 && y < h)
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define repc(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

typedef long long ll ;
typedef deque<int> di ;
typedef deque<ll> dl ;
typedef map<string,int> dict;
typedef complex<double> comd;
typedef pair<int,int> pii;

constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0};
const int dx[] = {0,-1,0,1};

double CalcDist(comd p1, comd p2){
  return sqrt(pow(p1.X - p2.X,2.0) + pow(p1.Y -p2.Y,2.0));
}

  template <typename T>
void out(deque < T > d)
{
  for(size_t i = 0; i < d.size(); i++)
  {
    debug(d[i]);
  }
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

string Decode(string s, int n){
  string res = s;
  rep(i,s.size()){
    if(s[i] != '.' && s[i] != ' '){
      if(s[i] + n > 'z'){
        res[i] = 'a' + (s[i] + n - 'z')-1;
      }
      else{
        res[i] = s[i] + n;
      }
    }
  }
  return res;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  int code;
  vector<string> vs;
  while(1){
    code = 0;
    getline(cin,s);
    if(cin.eof()) break;
    rep(i,27){
      if(Decode(s,i).find("this") != string::npos ||Decode(s,i).find("that") != string::npos||Decode(s,i).find("the") != string::npos){
        code = i;
        break;
      }
    }
    cout << Decode(s,code) << endl;
  }
  return 0;
}

C++: //include
 //------------------------------------------
 #include <vector>
 #include <list>
 #include <map>
 #include <set>
 #include <deque>
 #include <stack>
 #include <bitset>
 #include <algorithm>
 #include <functional>
 #include <numeric>
 #include <utility>
 #include <sstream>
 #include <iostream>
 #include <iomanip>
 #include <cstdio>
 #include <cmath>
 #include <cstdlib>
 #include <cctype>
 #include <string>
 #include <cstring>
 #include <ctime>

 using namespace std;

 //conversion
 //------------------------------------------
 inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
 template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

 //math
 //-------------------------------------------
 template<class T> inline T sqr(T x) {return x*x;}

 //typedef
 //------------------------------------------
 typedef vector<int> VI;
 typedef vector<VI> VVI;
 typedef vector<string> VS;
 typedef pair<int, int> PII;
 typedef long long LL;
 typedef unsigned long long ULL;

 //container util
 //------------------------------------------
 #define ALL(a)  (a).begin(),(a).end()
 #define RALL(a) (a).rbegin(), (a).rend()
 #define PB push_back
 #define MP make_pair
 #define SZ(a) int((a).size())
 #define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
 #define EXIST(s,e) ((s).find(e)!=(s).end())
 #define SORT(c) sort((c).begin(),(c).end())

 //repetition
 //------------------------------------------
 #define FOR(i,a,b) for(int i=(a);i<(b);++i)
 #define REP(i,n)  FOR(i,0,n)

 //constant
 //--------------------------------------------
 const double EPS = 1e-10;
 const double PI  = acos(-1.0);

 //clear memory
 #define CLR(a) memset((a), 0 ,sizeof(a))

 //debug
 #define dump(x)  cerr << #x << " = " << (x) << endl;
 #define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

 int main() {
   int n;
   string str;

   while(getline(cin, str)) {
     for(int i = 0; i < str.size(); i++) {
       for(int j = 0; str[i]+j <= 'z'; j++) {
	 if(str[i]+j == 't' && str[i+1]+j == 'h' && (str[i+2]+j == 'e' || str[i+2]+j == 'i' || str[i+2]+j == 'a')) {
	   n = j;
	   break;
	 }
       } 
       for(int j = 0; str[i]-j >= 'a'; j++) {
	 if(str[i] - j == 't' && str[i+1] - j == 'h' && (str[i+2]+j == 'e' || str[i+2]+j == 'i' || str[i+2]+j == 'a')) {
	   n = -j;
	 break;
	 }
       }
     }
     
     for(int i = 0; i < str.size(); i++) {
       if(str[i] == ' ' || str[i] == '.' || str[i] == '\n') printf("%c", str[i]);
       else printf("%c", str[i]+n);
     }
     cout << endl;
   }
 }