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;
map<char, char> change;

int main() {
	for ( int i = 0; i < 26; i++ ) {
		change[ i + 'a' ] = ( i + 25 ) % 26 + 'a';
	}
	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 <iostream>
#include <cstdio>
#include <cstring>

using namespace std;

void caesar(char* a)
{
	for (int i=0; i<strlen(a); i++) {
		if (a[i] == ' ' || a[i] == '.') continue;
		else if (a[i] == 'z') a[i] = 'a';
		else a[i]++;
	}
}

int main()
{
	char buf[81];
	
	while ( cin.getline(buf, sizeof(buf)) ) {
		int len = strlen(buf);
		for (int i=0; i<26; i++) {
			if ( (strstr(buf, "the") != NULL) || (strstr(buf, "this") != NULL) || (strstr(buf, "that") != NULL) ) {
				cout << buf << endl;
				break;
			}
			caesar(buf);
		}
	}
	
	return 0;
}

C++: #include<iostream>
using namespace std;
int main()
{
	char key[100] = "";
	
	while (cin.getline(key, sizeof(key))) {

		for (int i = 0; i < sizeof(key); i++)
		{
			//if (key[i] == (int)" ")cout << "space";
			if ((int)key[i] == 0)break;
			if ((int)key[i] <= 122 && (int)key[i] >= 97)
				key[i] = (int)key[i] - 1;
			if (key[i] == 96)key[i] = 122;
		}
		for (int i = 0; i < sizeof(key); i++)
		{
			if ((int)key[i] == 0)break;
			cout << key[i];
		}
	}
	return 0;
}

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

int main(){
    char a[81];
    int size;
    int i,t;
    while(scanf("%s",a)!=EOF){
        size = strlen(a);
        for(t=0;t<26;t++){
            for(i=0;i<size;i++)if(isalpha(a[i]))a[i] = 'a'+(a[i]+1-'a')%26;
            for(i=0;i<size;i++){
                if(a[i]=='t'&&a[i+1]=='h'){
                    if(a[i+2]=='e'||(a[i+2]=='i'&&a[i+3]=='s')||(a[i+2]=='a'&&a[i+3]=='t')){
                        printf("%s",a);
                        return 0;
                    }
                }
            }
        }
    }
}

C++: #include <bits/stdc++.h>

using namespace std;

inline char shift(char c, int i) {
  return char(((c + i) - 'a') % 26 + 'a');
}

int main() {
  string str;
  while (getline(cin, str)) {
    int n;
    for (int i = 0; i < 26; ++i) {
      string target;
      for (char c : str) {
        if ('a' <= c && c <= 'z')
          target += shift(c, i);
        else
          target += c;
      }
      for (string key : {"the", "this", "that"}) {
        size_t pos = target.find(key);
        if (pos != string::npos) {
          n = i;
          str = target;
          goto found;
        }
      }
    }

found:
    cout << str << endl;
  }
}

C++: #include <cmath>
#include <iostream>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
#include <sstream>

using namespace std;

string decode(string inp,int n){
    for(int i=0;i<inp.length();i++){
        if('a'<=inp[i]&&inp[i]<='z'){
            
            inp[i]=inp[i]-n;
            if(inp[i]<'a') inp[i]+=('z'-'b');
        }
    }
    return inp;
}
bool check(string inp){
    string word;
    stringstream ss(inp);
    while(getline(ss,word,' ')){
        if(word=="the"||word=="this"||word=="that"||word=="the."||word=="this."||word=="that.")
            return true;
    }
    return false;
}
int main(){
    string input,decoded;
    while(getline(cin,input)){
        for(int i=0;i<=26;i++){
            decoded=decode(input,i);
            if(check(decoded)){
                break;
            }
        }
        cout << decoded << endl;
    }
    return 0;
}

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

using namespace std;


int main(){

	string line;

	while(getline(cin, line)){

		string str[80], ans[80];
		int count = 0;
		int flag = 0;
		int slide;

		//???????????????
		/*
		string temp;
		for(int i=0 ; i<line.size()-1 ; i++){
			temp += line[i];
		}
		line = temp;
		*/

		//???????????????????????¨???????´?
		for(int i=0 ; i<line.size() ; i++){
			if(line[i] == ' '){
				count++;
			}else{
				str[count] += line[i];
				ans[count] = str[count];
			}
		}
		count++;


		for(int i=1 ; i<=26 ; i++){
			for(int j=0 ; j<count ; j++){
				for(int k=0 ; k<str[j].size() ; k++){
					if(str[j][k] != '.'){
						str[j][k]++;
						if(str[j][k] > 'z'){
							str[j][k] = str[j][k] - 'z' + 'a' -1;
						}
					}
					if(str[j][k] == 'h' && str[j][k-1] == 't'){
						flag = 1;
						slide = i;
						break;
					}
				}

				/*
				if(str[j] == "this" || str[j] == "the" || str[j] == "that"
						|| str[j] == "this." || str[j] == "the." ||str[j] == "that."){
					flag = 1;
					slide = i;
					break;
				}
				*/
			}
			if(flag == 1)break;
		}

		for(int i=0 ; i<count ; i++){
			for(int j=0 ; j<ans[i].size() ; j++){
				if(ans[i][j] != '.'){
					if((ans[i][j] + slide) > 'z' ){
						ans[i][j] = ans[i][j] - 'z' + 'a' + slide -1;
					}else{
						ans[i][j] = ans[i][j] + slide ;
					}
				}
			}
		}

		for(int i=0 ; i<count ; i++){
			cout << ans[i] << ' ';
		}
		cout << ans[count] << endl;

	}
	return 0;
}