Go: package main

import (
	"bufio"
	"os"
	"strings"
	"fmt"
)

var scanner = bufio.NewScanner(os.Stdin)

func cipher(text string, direction int, int_shift int) string {
	shift, offset := rune(int_shift), rune(26)
	runes := []rune(text)
	for index, char := range runes {
		switch direction {
		case 1:
			if char >= 'a' && char <= 'z'-shift || char >= 'A' && char <= 'Z'-shift {
				char = char + shift
			} else if char > 'z'-shift && char <= 'z' || char > 'Z'-shift && char <= 'Z' {
				char = char + shift - offset
			}
		case -1:
			if char >= 'a'+shift && char <= 'z' || char >= 'A'+shift && char <= 'Z' {
				char = char - shift
			} else if char >= 'a' && char < 'a'+shift || char >= 'A' && char < 'A'+shift {
				char = char - shift + offset
			}
		}
		runes[index] = char
	}
	return string(runes)
}

func main() {
	for scanner.Scan() {
		infos := strings.Split(scanner.Text(), " ")
		plain := make([]string, len(infos))
		// fmt.Println(infos)
		Decryption:
			for i := 0; i < 26; i++ {
				for j := range infos {
					plain[j] = cipher(infos[j], 1, i)
				}
				for j := range plain {
					if plain[j] == "this" || plain[j] == "that" || plain[j] == "the" {
						break Decryption
					}
				}
			}
			fmt.Println(strings.Join(plain, " "))
	}
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <ctype.h>
#include <algorithm>
using namespace std;

#define loop(i,a,b) for(int i=(a); i<(int)(b); i++)
#define rep(i,b) loop(i,0,b)
#define all(c) (c).begin(), (c).end()
 
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

int main() {
  string s; getline(cin, s);
  int slide = 0;
  rep(i, s.size()-4) {
    if(islower(s[i]) == 0) continue;
    rep(j, 26) {
      string sub;
      rep(k, 4) sub += (s[i+k]-'a'+j+52)%26 + 'a';
      if(sub.substr(0,3) == "the") slide = j;
      else if(sub == "this" || sub == "that") slide = j;
    }
    if(slide != 0) break;
  }
  rep(i, s.size()) {
    if(islower(s[i]) != 0)printf("%c", (s[i]-'a'+slide+52)%26 + 'a');
    else cout << s[i];
  }
  cout << endl;
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <ctype.h>

using namespace std;

string slide(string s) {
  string r = s;
  for (int i = 0; i < r.length(); i++) {
    if (islower(r[i])) {
      if (r[i] == 'z') r[i] = 'a';
      else r[i] += 1;
    }
  }
  return r;
}

bool check_word(string s) {
  string dic[3] = {"this", "the", "that"};
  for (int i = 0; i < 3; i++)
    if (s.find(dic[i]) != string::npos) return true;
  return false;
}

int main() {
  string in, temp;
  bool found;
  while (1) {
    getline(cin, in);
    if (cin.eof()) break;
    for (temp = in, found = false; ; temp = slide(temp)) {
      found = check_word(temp);
      if (found) break;
    }
    cout << temp << endl;
  }
  return 0;
}

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