Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func incrementByte(b byte) byte {
	if b >= 97 && b < 122 {
		return b + 1
	} else if b == 122 {
		return 97
	}
	return b
}

func main() {
	scanner.Split(bufio.ScanLines)

	for {
		line := nextString()
		if len(line) == 0 {
			break
		}
		for i := 0; i <= 26; i++ {
			decoded := []byte{}
			for j := 0; j < len(line); j++ {
				decoded = append(decoded, incrementByte(line[j]))
			}
			line = string(decoded)
			if strings.Contains(line, "the") || strings.Contains(line, "this") || strings.Contains(line, "that") {
				fmt.Println(line)
				break
			}
		}
	}
}

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 <cstdio>
#include <cstring>
#include <cctype>
#include <algorithm>
using std::__gcd;
using std::sort;

void trans(char *s,char *p,int shift){
	for(int i=0;;++i){
		if( isalpha(s[i]) )
			p[i] = (s[i]-'a'+shift)%26 + 'a';
		else p[i] = s[i];
		if( s[i] == 0 ) return;
	}
}

bool check(char *s){
	if( *s != 't' ) return 0;
	++s;
	if( *s != 'h' ) return 0;
	++s;
	if( *s == 'e' ) return 1;
	else if( *s == 'i' && *(s+1) == 's' ) return 1;
	else if( *s == 'a' && *(s+1) == 't' ) return 1;
	return 0;
}

int main(){
	char s[100];
	while( gets(s) ){
		char p[100];
		bool ok = 0;
		for(int i=0;!ok&&i<26;++i){
			trans(s,p,i);
			for(int j=0;!ok&&s[j];++j)
				if(check(p+j)) ok = 1;
		}
		printf("%s\n",p);
	}
	return 0;	
}

C++: a='abcdefghijklmnopqrstuvwxy'
b=input()
for i in range(26):
 c=''.join(a[ord(e)-97-i]if e in a else e for e in b)
 if any(('the 'in c,'this 'in c,'that 'in c)):print(c);break

C++: #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define pi acos(-1)
#define MIN(a,b) (a < b ? a : b)
#define MAX(a,b) (a > b ? a : b)
int main()
{
	char s[100],ch;
	int len,i,j,x,y,z,shift,m,c,shift1,shift2,shift3,shift4,shift5,shift6;
	while(gets(s)){
		len=strlen(s);
		c=0;
		for(i=0;i<len;i++){
			if(s[i]>='a'&&s[i]<='z'){
				c++;
			}
			else{
				if(c==3||c==4){
					//printf("c:%d\n",c);
					if(c==3){
						shift1=abs(s[i-3]-'t');
						shift2=abs(s[i-2]-'h');
						shift3=abs(s[i-1]-'e');
						if(shift1==shift2&&shift2==shift3){
							shift='t'-s[i-3];
							printf("%c\n",s[i-3]);
							break;
						}
					}
					if(c==4){
						shift1=abs(s[i-4]-'t');
						//printf("%d %d\n",s[i-3],'t');
						shift2=abs(s[i-3]-'h');
						shift3=abs(s[i-2]-'i');
						shift4=abs(s[i-1]-'s');
						shift5=abs(s[i-2]-'a');
						shift6=abs(s[i-1]-'t');
						//printf("%d %d %d %d %d %d\n",shift1,shift2,shift3,shift4,shift5,shift6);
						if((shift1==shift2&&shift2==shift3&&shift3==shift4)||(shift1==shift2&&shift2==shift5&&shift5==shift6)){
							//printf("%d\n",s[i]);
							shift='t'-s[i-4];
							break;
						}
					}
				}
				c=0;
			}
		}
		//printf("%d\n",shift);
		for(i=0;i<len;i++){
			if(s[i]>='a'&&s[i]<='z'){
				m=s[i]-96;
				//printf("m:%d m+shift:%d\n",m,m+shift);
				if(m+shift>26)s[i]=(m+shift-26)+96;
				else if(m+shift<1)s[i]=96+(26+m+shift);
				else s[i]=96+m+shift;
			}
		}
		for(i=0;i<len;i++){
			printf("%c",s[i]);
		}
		printf("\n");
		memset(s,0,sizeof(s));
	}
	return 0;
}

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

int main() {
  string str;
  while(getline(cin,str)){
    for(int i = 0;i < 26;i++){
      for(int i = 0;i <str.size();i++){
        if(isalpha(str[i]))
          str[i] = (str[i]=='z')? 'a' : str[i] + 1;
      }
      if(str.find("the") !=string::npos||str.find("that") !=string::npos||
         str.find("this") !=string::npos){
        cout <<str<<endl;
        break;
      }
    }
  }
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <list>
#include <algorithm>
#include <cmath>
#include <stack>
#include <set>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define FOR(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define PUSH(n,v) for(int i=0; i<(n); i++) {int j; cin >> j; v.push_back(j);}
#define ALL(v) v.begin(), v.end()

void rot1(string &s) {
    string t = "";
    REP(i,s.size()) {
        if (s[i] >= 'a' && s[i] <= 'z') {
            if (s[i] == 'a') t += "z";
            else t += s[i] - 1;
        }else {
            t += s[i];
        }
    }
    s = t;
}

int main() {
    string s;
    while(getline(cin, s)) {
        while(s.find("the") == string::npos && s.find("this") == string::npos && s.find("that") == string::npos) {
            rot1(s);
        }
        cout << s << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
//#include <regex>
#include <cctype>
#include <string>
#include <utility>
using namespace std;

vector<string> v;
/*
vector<string> split(string&& s, regex&& pattern) {
    sregex_token_iterator first(s.begin(), s.end(), pattern, -1);
    sregex_token_iterator last;
    return(vector<string>(first, last));
}
*/
bool cheser() {
    for(int r = 1; r <= 26; r++) {
        bool found = false;
        for(int c = 0; c < v.size(); c++) {
            for(int k = 0; k < v[c].length(); k++) {
                if(!isalpha(v[c][k])) continue;
                int now = v[c][k] - 'a';
                now = (now+1)%26;
                v[c][k] = 'a' + now;
            }
            if(v[c] == "the" || v[c] == "this" || v[c] == "that") found = true;
        }
        if(found) return(true);
    }
    return(false);
}

int main(void) {
    string input;
    while(getline(cin, input)) {
       // v = split(move(input), regex(" "));
        cheser();
        for(int r = 0; r < v.size(); r++) {
            cout << v[r];
            if(r == v.size() - 1) cout << endl;
            else                  cout << " ";
        }
    }
    
    return(0);
}