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 <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;

int main() {
	string str_copy;
	set<string> s;
	getline( cin, str );
	for ( int i = 1; i < 26; i++ ) {
		str_copy = str;
		bool can_continue = false;
		for ( int j = 0; j < str_copy.size(); j++ ) {
			if ( str_copy[ j ] >= 'a' && str_copy[ j ] <= 'z' ) {
				str_copy[ j ] += 26;
				str_copy[ j ] -= i;
				str_copy[ j ] = ( ( str_copy[ j ] - 'a' ) % 26 ) + 'a';
				if ( str_copy[ j ] < 'a' || str_copy[ j ] > 'z' ) {
					can_continue = true;
					break;
				}
			}
		}
		if ( s.count( str_copy ) ) {
			continue;
		}
		s.insert( str_copy );
		if ( can_continue ) {
			continue;
		}
		bool is_can = false;
		for ( int j = 0; j < str_copy.size() - 2; j++ ) {
			if ( str_copy.substr( j, 3 ) == "the" ) {
				is_can = true;
				break;
			}
		}
		for ( int j = 0; j < str_copy.size() - 3; j++ ) {
			if ( str_copy.substr( j, 4 ) == "that" || str_copy.substr( j, 4 ) == "this" ) {
				is_can = true;
				break;
			}
		}
		if ( is_can ) {
			break;
		}

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

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;

int main(){
	char input[81],str[50][81];
	const char cmp[3][5]={"that","this","the"};
	int pos=0,last_pos=0,i,j,k,diff;

	while(fgets(input,81,stdin)!=NULL){;
		last_pos=0;
		pos=0;
		for(i=0;input[i]!='\0';i++){
			if(input[i]==' ' || input[i]=='.' || input[i]=='\n'){
				for(j=last_pos;j<i;j++){
					str[pos][j]=input[j];
				}
				str[pos][j]='\0';
				pos++;
				last_pos=i+1;
			}
		}

		for(i=0;i<pos;i++){
			for(j=0;j<3;j++){
				diff=str[i][0]-cmp[j][0];
				for(k=1;str[i][k]!='\0' && cmp[j][k]!='\0';k++){
					if(diff!=str[i][k]-cmp[j][k]){
						break;
					}
				}
				if(str[i][k]=='\0' && cmp[j][k]=='\0'){
					j=3;i=pos;
				}
			}
		}

		for(i=0;input[i]!='\n';i++){
			if(input[i]!='.' && input[i]!=' '){
				input[i]-=diff;
			}
		}

		printf("%s",input);
	}

	return 0;
}

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

int main(void)
{


	char str[100];
	while(gets(str)){

	while(!strstr(str, "this") && !strstr(str, "the") && !strstr(str, "that")){
		for(int i = 0; i < strlen(str); i++){
			if(str[i] >= 'a' && str[i] <= 'a'+26)
				str[i] = 'a' + (str[i] - 'a' + 1) % 26;
		}
	}

	printf("%s\n", str);
	}

	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
vector<string> split(string &s, char delimiter){
  vector<string> res;
  int prev_split_point = 0;
  for (int i = 0; i < s.length(); i++) {
    while(s[i] != delimiter && i < s.length())i++;
    string add = s.substr(prev_split_point, i - prev_split_point);
    if(!add.empty())res.push_back(add);
    prev_split_point = i + 1;
  }
  return res;
}

int main(int argc, char *argv[]){
  char c[26];
  for (int i = 0; i < 26; i++) {
    c[i] = 'a' + i;
  }
  vector<string> vs;
  string s;
  string ans[] = {"this", "that", "the"};
  vector<string> tmp;
  while(getline(cin, s)){
    vs = split(s, ' ');
    int n = vs.size();
    for (int k = 0; k < 26; k++) {
      tmp = vs;
      for (int i = 0; i < vs.size(); i++) {
        for (int j = 0; j < vs[i].length(); j++) {
          if('a' <= tmp[i][j] && tmp[i][j] <= 'z')
            tmp[i][j] = c[(vs[i][j] - 'a' + k) % 26];
        }
      }
      for (int i = 0; i < 3; i++) {
        for (int j = 0; j < tmp.size(); j++) {
          if(tmp[j] == ans[i]){k = 50, i = 10, j = 1000;}
        }
      }
    }
    for (int i = 0; i < tmp.size(); i++) {
      std::cout << tmp[i];
      if(i == tmp.size() - 1)std::cout << std::endl;
      else std::cout << " ";
    }
  }
  return 0;
}

C++: #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>

using namespace std;

typedef long long Int;
typedef vector<int> vint;
typedef pair<int,int> pint;
#define mp make_pair

template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }
int in() { int x; scanf("%d", &x); return x; }

int main() {
	string str;
	char chr[100];
	for(;gets(chr);){
		str=chr;
		int len=str.size();
		int i,c;
		for(c=1;c<=26;c++){
			for(i=0;i<len;i++){
				if('a'<=str[i]&&str[i]<='z'){
					str[i]++;
					if(str[i]>'z')str[i]='a';
				}
			}
			//cout<<str<<endl;
			//if(str.find("the")!=string::npos||str.find("this")!=string::npos||str.find("that")!=string::npos){
				cout<<str<<endl;
				break;
//			}
		}
	}
	return 0;
}

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

using namespace std;

int main() {
    string a;
    
    while(getline(cin,a)){
    
    while (1){
        if(a.find("this")!=-1 || a.find("the")!=-1 || a.find("that")!=-1){
            break;
        }
        
        for(int i=0; i<(int)a.length(); i++){
            if(a[i]==' '|| a[i]=='.'){
                
            }else if(a[i]=='z'){
                a[i]='a';
            }else{
                a[i]++;
            }
        }

    }
    cout<<a<<endl;;
    }
    
    return 0;
}