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

using namespace std;

string dict = "abcdefghijklmnopqrstuvxwyz";

string decode(string s, int v) {
    string ans = s;
    for(int i = 0; i < (int) s.size(); i++) {
        if(s[i] >= 'a' && s[i] <= 'z') {
            ans[i] =  dict[((s[i] + v) % 26)];
        }
    }
    return ans;
}

int main() {
    string s;

    while(getline(cin, s)) {
        if(s.size <= 1) break;
        for(int i = 1; ; i++) {
            string tmp = decode(s, i);
            if(tmp.find("this") != string::npos && tmp.find("the") != string::npos && tmp.find("that") != string::npos) {
                cout << tmp << endl;
                break;
            }
         }
    }
    return 0;
}

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

int main() {
	string s;
	while(getline(cin, s)){
		string ans;
		int maxim = 0;
		for(int i = 0; i < 26; ++i){
			for(int j = 0; j < s.size(); ++j){
				if(s[j] == 'a')
					s[j] = 'z';
				else if(s[j] == ' ' || !('a' <= s[j] && s[j] <= 'z'))
					continue;
				else
					s[j]--;
			}
			string t("");
			int cnt = 0;
			for(int j = 0; j < s.size(); ++j){
				if(s[j] == ' '){
					if(t == "the" || t == "this" || t == "that")
						cnt++;
					t = "";
				}
				else{
					t += s[j];
				}
			}
			if(maxim < cnt){
				ans = s;
				maxim = cnt;
			}
		}
		cout << ans << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cstdlib>
#include <string>
#include <cctype>
#include <algorithm>
using namespace std;

char cShiftchar(char ch)
{
    if(isalpha(ch))
    {
        ch++;
        if(ch > 'z') ch = ch - 'z';
    }

    return ch;
}

string sDecode(string str)
{
    string ans;
    while( str.find("the")
            || str.find("this")
            || str.find("that")
         )
        transform(str.begin(), str.end(), str.begin(), cShiftchar);
    return ans;
}

int main()
{
    string str;
    while(getline(cin, str))
    {
        cout << sDecode(str) << endl;
    }
    return EXIT_SUCCESS;
}

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

using namespace std;
typedef long long LL;
static const double EPS = 1e-9;

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n) 
void decode(vector<string> &words)
{
  int s=0;
  REP(i,words.size()){
    REP(j,26){
      REP(k,words[i].size()){
        if(words[i][k] >= 'a' && words[i][k] <= 'z' )
        words[i].replace(k, 1, 1,
              'a' + ( words[i][k] + 1 - 'a')%26 );
        
        if(words[i] == "the"||words[i] == "this" || words[i] == "that" ||
           words[i] == "the." || words[i] == "this." || words[i] == "that." )
          s = j;
      }
    }
  }
  REP(i,words.size())
    REP(j,words[i].size())
      if(words[i][j] >= 'a' && words[i][j] <= 'z' )
        words[i].replace(j, 1, 1, 'a' + (words[i][j] + s+1 - 'a')%26 );
}

int main(void){  
  vector<string> words;
  string bf;

  while(true){
    if(!(cin >> bf)) break;
    words.push_back(bf);
    if(bf.find('.') != string::npos){
      decode(words);
      cout << words[0];
      FOR(i,1,words.size())
        cout << " " << words[i];
      cout << endl;
      words.clear();
    }
  }
  return 0;
}

C++: #include<iostream>
#include<map>
#include<string>
using namespace std;

typedef pair<string, string> P;

P next_word(string sentence) {
  if (sentence.empty()) return make_pair(string(""), string(""));
  if (sentence[0] == ' ' || sentence[0] == '.') {
    return make_pair("", sentence.substr(1));
  } else {
    P recur = next_word(sentence.substr(1));
    return make_pair(sentence[0] + recur.first, recur.second);
  }
}

bool acceptable(string sentence) {
  P p = next_word(sentence);

  while (! p.first.empty() ) {
    if (p.first == "this" || p.first == "the" || p.first == "that")
      return true;

    p = next_word(p.second);
  }
  return false;
}

char slip(char c) {
  if (c < 'a' || 'z' < c) return c;
  
  string alphabet = "abcdefghijklmnopqrstuvwxyza";
  int index = (int)(c - 'a');
  return alphabet[index + 1];
}

char slip(char c, int n) {
  for (int i = 0; i < n; i++)
    c = slip(c);

  return c;
}

string slip(string code, int n) {
  string val;
  for (int i = 0, len = code.length(); i < len; i++)
    val += slip(code[i], n);

  return val;
}

string decode(string code) {
  for (int i = 1; i < 27; i++) {
    string sentence = slip(code, i);
    if (acceptable(sentence))
      return sentence;
  }

  return "";
}

int main() {
  string code;
  while ( getline(cin, code) )
    cout << decode(code) << endl;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
	string b[100];
	int i,j,k,n;
	int s=0;
	while(1){
		i=0;
		s=0;
		while(cin>>b[i]){
			if(b[i][b[i].size()-1]=='.')break;
			i++;
		}
		b[i].erase(b[i].end()-1);
		for(int h=0;h<30;h++){
			for(j=0;j<=i;j++){
				n=b[j].size();
				for(k=0;k<n;k++){
					if(b[j][k]=='a'){
						b[j][k]='z';
					}else{
						b[j][k]--;
					}
				}
			}
			for(j=0;j<=i;j++){
				if(b[j]=="this" || b[j]=="the" || b[j]=="that")s=1;
			}
			if(s==1)break;
		}
		for(j=0;j<=i;j++){
			cout<<b[j];
			if(j!=i)cout<<" ";
		}
		cout<<"."<<endl;
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,maxe=0,co=0;;
    char str[82][82];
    for(int i=0;;i++){
        cin>>str[i];
        n=strlen(str[i]);
        if(str[i][n-1]=='.'){
                maxe=i+1;
                break;
        }
    }
    for(int i=1;;i++){
        for(int j=0;j<maxe;j++){
            if(str[j][0]-i=='t'){
                if(str[j][1]-i=='h'&&str[j][2]-i=='i'&&str[j][3]-i=='s'||str[j][1]-i=='h'&&str[j][2]=='e'||str[j][1]-i=='h'&&str[j][2]-i=='a'&&str[j][3]=='t'){
                    co=i;
                    break;
                }
            }
        }
        if(co!=0)break;
    }
    for(int i=0;i<maxe;i++){
        for(int j=0;str[i][j]!='\0';j++){
                if(str[i][j]!='.')printf("%c",str[i][j]-co);
                else cout<<".";
        }
        if(i!=maxe-1)cout<<" ";
        else cout<<endl;
    }


}