Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

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

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 {
		infos := strings.Split(nextString(), " ")
		plain := make([]string, len(infos))
		if len(infos) == 0 {
			break
		}
		// 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 <cstdio>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <cmath>
using namespace std;

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define llong long long

int main() {
  char *a = (char*)malloc(sizeof(char)*82);
  size_t l = 0;
  while (getline(&a, &l, stdin) != EOF) {
    while(1) {
      int q = 0;//1..t, 2..th, 3..the, 4...thi, 5..this, 6..tha, 7..that 
      REP(j , (int)l) {
	if(a[j] == 'z') a[j] = 'a';
	else if(a[j] >= 'a' && a[j] < 'z') a[j]++;
      }
      REP(j , (int)l) {
	switch(q){
	case 0:
	  if(a[j] == 't') q++;
	  break;
	case 1:
	  if(a[j] == 'h') q++;
	  else q = 0;
	  break;
	case 2:
	  if(a[j] == 'e') q = 3;
	  else if(a[j] == 'i') q = 4;
	  else if(a[j] == 'a') q = 6;
	  else q = 0;
	  break;
	case 4:
	  if(a[j] == 's') q = 5;
	  else q = 0;
	  break;
	case 6:
	  if(a[j] == 't') q = 7;
	  else q = 0;
	  break;
	}
      }
      if(q == 3 || q == 5 || q == 7) break;
    }
    
    REP(i , (int)l) {
      printf("%c",a[i]);
    }
  }
  return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
int main() {
  string line;
  while (getline(cin, line)) {
    while (line.find("the") == string::npos && line.find("this") == string::npos
      && line.find("that") == string::npos)
      for (auto& c : line)
        if (c == 'a') c = 'z';
        else if (c != '.' && c != ' ') c -= 1;
    cout << line << endl;
  }
}

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

const int ALPHA = 26;

int main(){
	string input;
	while(cin && getline(cin, input)){
		string cand[ALPHA];
		for(int i=0; i<ALPHA; i++){
			cand[i] = "";
			for(int n=0; n<input.size(); n++){
				if('a'<=input[n]&&input[n]<='z'){
					cand[i] += (input[n]-'a'+i)%ALPHA + 'a';
				} else {
					cand[i] += input[n];
				}
			}
			if(cand[i].find("the") != string::npos
				|| cand[i].find("this") != string::npos
				|| cand[i].find("that") != string::npos){
				cout<<cand[i]<<endl;
			}
		}
	}
	return 0;
}

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

int main(){
	string num;
	int t;
	while( getline(cin,num)){
		while(1){
			for(int i=0;num[i]!='\0';i++){
				if(num[i]=='a'){
					num[i]='z';
				}
				else if(num[i]>'a'&& num[i]<='z'){
					num[i]--;
				}
			}
			t=0;
			for(int i=0;num[i]!='\0';i++){
				if(num[i]=='t' && num[i+1]=='h'){
					if(num[i+2]=='e')t=1;
					if(num[i+2]=='i'&&num[i+3]=='s')t=1;
					if(num[i+2]=='a'&&num[i+3]=='t')t=1;
				}
			}
			if(t==1)break;
		}
		cout << num << "\n";
	}
	return 0;
}

C++: #include<iostream>
#include<string>
#include<string.h>
using namespace std;
bool search(string);
int main()
{
	string s;
	getline(cin, s);
	while (true){
		for (int i = 0; i < s.size(); i++){
			if (s[i] == 'a'){
				s[i] = 'z';
			}
			else if (s[i]>'a'&&s[i] <= 'z'){
				s[i]--;
			}
		}
		if (search(s)){
			cout << s << endl;
			break;
		}
	}
}
bool search(string s){
	string p[] = { { "the" }, { "this" }, { "that" } };
	for (int i = 0; i < s.size(); i++){
		if (s[i] == 't'){
			for (int j = 0; j < 3; j++){
				int count = 0;
				for (int i2 = i; i2 < i + p[j].size(); i2++,count++){
					if (p[j][count] != s[i2]){
						break;
					}
				}
				if (count == p[i].size()){
					return true;
				}
			}
		}
	}
	return false;
}

C++: #include <bits/stdc++.h>
 
using namespace std;
 
#define FOR(i, j, k) for(int i = j; i < k; ++i)
#define rep(i, j) FOR(i, 0, j)
#define repr(i, j) for(int i = j; i >= 0; --i)
#define INF (1 << 30)
#define MOD 1e9 + 7
 
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
 
int main() {
    string s;
    bool flag = false;
    int key = 1;
    while(getline(cin, s)){
    	while(s != "the" && s != "that" && s != "this") {
	    	rep(i, s.size()) {
	            if(97 <= s[i] && s[i] <= 122) {
	                int number = (s[i] - 'a' + key) % 26;
	                s[i] = 'a' + number;
	            }
	        }
	    }
	    cout << s << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <string>

using namespace std;

int main()
{
  string stro, str;
  while(getline(cin, stro)){
    for(int i = 1; i < 26; i++){
      str = stro;
      for(int j = 0; j < stro.length(); j++){
	if(str[j] != ' ' && str[j] != '.' && str[j] != '\n')
	  if(str[j] + i > 'z')
	    str[j] += i - 26;
	  else
	    str[j] += i;
      }

      if(str.find("the", 0) != string::npos || str.find("this", 0) != string::npos || str.find("that", 0) != string::npos)
	cout << str << endl;	
    }
  }
}

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()==3||words[i].size()==4){
      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")
            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;
}