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>
using namespace std;

int main(){

	string code;

	while( getline(cin, code) ){

		for( int j=0;j<25;j++ ){
			for( int i=0;i<code.length();i++ ){
				if( code[i] >= 'a' && code[i] <= 'z' ){
					code[i] += 1;
					if(code[i]=='z'+1)code[i]='a';
				}
			}
			if(code.find("the ") != -1 || code.find("this") != -1 || code.find("that") != -1)
				break;		
		}
		cout << code << endl;
	}
	return 0;

}

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

using namespace std;

void f(string &s)
{
    for (char &c : s) {
        if ('a' <= c && c <= 'z') c = (c + 25) % 26 + 'a';
    }
}

int main()
{
    string s;

    while (getline(cin, s)) {
        if (s.empty()) break;
        while (s.find("the") == string::npos && s.find("this") == string::npos && s.find("that") == string::npos) f(s);
        cout << s << endl;
    }
}

C++: #define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
typedef long long ll;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

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

int main(){
  string s;
  
  while(getline(cin,s)){
  
  rep(i,26){
    rep(j,s.size()){
      if(s[j]!=' ' && s[j]!='.'){
        if(s[j]!='z') s[j]++;
        else s[j]='a';
      }
    }
    if(s.find("the") != string::npos || s.find("this") != string::npos || s.find("that") != string::npos){
      break;
    }
  } 
  
  cout<<s<<endl;
  }
    
  return 0;
}

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

int main() {
	int i, j;
	string news;
	while (getline(cin, news)){
		for (i = 1; i <= 25; i++) {
			for (j = 0; j < news.size(); j++){
				if (news[j]>'a' && news[j] <= 'z')news[j] -= 1;
				else if (news[j] == 'a') news[j] = 'z';
			}
			for (j = 0; j < news.size() - 2; j++) {
				if ((news[j] == 't'&&news[j + 1] == 'h') && (news[j + 2] == 'e' || (news[j + 2] == 'i'&&news[j + 3] == 's') || (news[j + 2] == 'a'&&news[j + 3] == 't'))) {
					goto end;
				}
			}
		}
	end:
		cout << news << endl;
	}
}

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

int main(){
  string s;
  getline(cin,s);
  for(int i=0;i<25;i++){
    for(int j=0;j<=s.size();j++){
      if(s[j] >= 'a' && s[j] <= 'y') s[j]++;
      else if(s[j] == 'z') s[j]='a';
    }
      if((s.find("this")!=string::npos) || (s.find("that")!=string::npos) || (s.find("the")!=string::npos)) break;
  }
  cout << s << endl;
}

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 <iomanip>
#include <list>
#include <map>
#include <algorithm>
#include <stack>
#include <string>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>

using namespace std;

int main(){
	string tmp;
	string key[] = {"the","this","that"};
	int alfabet = 26;
	while(getline(cin,tmp)){

		while(alfabet--){

			for(string::iterator it = tmp.begin(); it != tmp.end(); it++){
				if(*it >= 'a' && *it <= 'z'){
					(*it)++;
					if(*it >= 'z'){
						*it = 'a';
					}
				}
			}
			for(int j = 0; j < 3; j++){
				if(tmp.find(key[j]) != string::npos){
					cout << tmp << endl;
					return 0;
				}
			}

		}

	}
	return 0;
}

C++: #include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b) - 1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)

#define PB push_back
#define INF INT_MAX/3
#define ALL(a) (a).begin(),(a).end()
#define CLR(a) memset(a,0,sizeof(a))

typedef long long int ll;

using namespace std;

int main(){

    string s[] = {"this","the","that"};
    vector<string> in;
    while(true){
	string temp;
	cin >> temp;
	if(cin.eof()) break;
	in.PB(temp);
	if(temp[temp.length()-1] == '.') {
	    in[in.size()-1].erase(in[in.size()-1].begin() + in[in.size()-1].size()-1);
	    break;
	}
    }
    bool f = false;
    int d = 1;
    REP(i,30){

	f = true;
	REP(i,in.size()) REP(j,in[i].size()){
	    in[i][j] = (char)( 'a' + ( (int)(in[i][j] - 'a') + d) % 28);
	}
	vector<bool> flgs(3,false);
	for(int i=0;i<in.size();i++){
	    REP(j,3){
		if(in[i] == s[j]) flgs[j] = true;
	    }
	}
	REP(i,3) if( !flgs[i]) f = false;
	if(f) break;
    }
    if(f){
	REP(i,in.size()-1) cout << in[i] << " ";
	cout << in[in.size()-1] << "." << endl;
    }

    return 0;
}

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) 

int main(void){  
  vector<string> words;
  string bf;
  int s = 0;
  while(cin>>bf) words.push_back(bf);
  REP(i,words.size()){
    if(words[i].size()>2){
      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')%('z'-'a'+1) );
        
          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')%('z'-'a'+1) );
  cout << words[0];
  FOR(i,1,words.size())
    cout << " " << words[i];
  cout << endl;
}