Go: package main

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

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 reflect.DeepEqual(infos, []string{}) {
			break
		}
		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 <vector>
#include <algorithm>
#include <cstdio>
#include <string>

#define rep(x,to) for(int x=0;x<to;x++)
#define rep2(x,from,to) for(x=from;x<to;x++)

using namespace std;


int main(void){

string inl;
vector<string> svs;
string ww[3] ={"the","this","that"};
	getline(cin,inl);
//	stringstream ss(inl);   
//	string elem;
//	while (ss >> elem)  svs.push_back(elem);

	rep(i,26){
		rep(j,inl.size()){
			if(inl[j] >= 'a' && inl[j] <= 'z') inl[j] += 1;
			if(inl[j] > 'z' ) inl[j] -= 26;
			
			}
		if(inl.find(ww[0]) != string::npos || inl.find(ww[1]) != string::npos
			|| inl.find(ww[2]) != string::npos )  cout << inl << endl;
//		 cout << i << "::" << inl << endl;

	}

	
	return 0;
}

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

using namespace std;

int main(){

    string s;
    vector<string> v;

    bool match = false;

    while(cin >> s) {
        v.push_back(s);
    }

    for(int i = 0; i < 26; ++i) {
        for(int j = 0; j < v.size(); ++j) {
            for(int k = 0; k < v[j].size(); ++k) {
                if(v[j][k] >= 'a' && v[j][k] <= 'z') {
                    v[j][k] = (v[j][k] + 1) % 'a' % 26 + 'a';
                }
            }
            if(v[j] == "the" || v[j] == "this" || v[j] == "that"
                || v[j] == "the." || v[j] == "this." || v[j] == "that.") {
                match = true;
            }
        }
        if(match) {
            for(int j = 0; j < v.size(); ++j) {
                cout << v[j];
                if(j  < v.size() - 1) {
                    cout << ' ';
                }
            }
            cout << endl;
            break;
        }
    }


}

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

int main(){
    string before;
    while (getline(cin, before)) {
        int swich = 0;
        for (int i = 0; ; i++) {
            for (int j = 0; j < before.size(); j++) {
                if (before[j]>'z') {
                    before[j] = 'a';
                }
                else if (isalpha(before[j])) {
                    before[j]++;
                }
            }
            for (int j = 0; j < before.size(); j++) {
                if (before[j]=='t'&& before[j+1]=='h'&& before[j+2]=='e') {
                    swich = 1;
                    break;
                }
                else if (before[j]=='t'&&before[j+1]=='h'&&before[j+2]=='a'&&before[j+3]=='t') {
                    swich = 1;
                    break;
                }
                else if (before[j]=='t'&&before[j+1]=='h'&&before[j+2]=='i'&&before[j+3]=='s') {
                    swich = 1;
                    break;
                }
            }
            if (swich == 1) {
                break;
            }
        }
        cout << before << endl;
    }
    return 0;
}

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

using namespace std;

int main(){
  string t,s;
  while(getline(cin,t)){
    s.append(t);
      }
  for(int i=1;i<26;i++){
    string ans;
    for(string::iterator it=s.begin();it!=s.end();it++){      
      if(*it==' '||*it=='.'){
	ans.push_back(*it);
	continue;
      }
      ans.push_back((char)(((int)*it-0x61+i)%26+0x61));
    }
    if(ans.find("the")!=string::npos||ans.find("this")!=string::npos||ans.find("that")!=string::npos){
      cout<<ans<<endl;
      break;
    }
  }
  return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <stdlib.h>
#include <vector>
#include <stack>

using namespace std;


int main(){
	string line;

	while(getline(cin, line)){
		int flag;

		for(int i=0 ; i<26 ; i++){
			for(int j=0 ; j<line.size() ; j++){
				if(line[j] != ' ' && line[j] != '.'){
					if((line[j]-1) < 'a'){
						line[j] = line[j]  -'a' + 'z' ;
					}else{
						line[j]--;
					}
				}
			}

			for(int k=0 ; k<line.size()-1 ; k++){
				if(line[k] == 't' && line[k+1] == 'h'){
					flag = 1;
					break;
				}
			}
			if(flag == 1) break;
		}
		cout << line << endl;
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
 
#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define SORT(c) sort((c).begin(),(c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
 
typedef long long ll;
typedef pair<int, int> ii;
 
int main(){

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

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

int checkCaesarChipher(string str1, string str2){
	int a[1000],b[1000];
	bool flag = false;
	
	for(unsigned int i=0 ; i<str1.size()-1 ; i++){
		a[i] = (str1[0] - str1[i] + 26 - 'a') % 26;
		b[i] = (str2[0] - str2[i] + 26 - 'a') % 26;
		if(a[i]==b[i]){
			flag = true;
		}else{
			flag = false;
			break;
		}
	}
	if(flag){
		return (str2[0] - str1[0]);
	}else{
		return 0;
	}
}

int main(){
	string str[400];
	int i=0, ans=0;
	while(cin >> str[i]){
		
		i++;
	}
	for(int j=0 ; j<i ; i++){
		ans = 0;
		if(str[j].size()==3){
			string hoge1 = "the";
			if(checkCaesarChipher( hoge1 , str[j] )!=0){
				ans = checkCaesarChipher( hoge1 , str[j] );
				break;
			}
		}
		if(str[j].size()==4){
			string hoge2 = "that";
			if(checkCaesarChipher( hoge2 , str[j] )!=0){
				ans = checkCaesarChipher( hoge2 , str[j] );
				break;
			}
			string hoge3 = "this";
			if(checkCaesarChipher( hoge3 , str[j] )!=0){
				ans = checkCaesarChipher( hoge3 , str[j] );
				break;
			}
		}
	}
	if(ans!=0){
		for(int j=0 ; j<i ; j++){
			for(unsigned int k=0 ; k<str[j].size() ; k++){
				if(str[j][ str[j].size()-1] != '.'){
					str[j].at(k) -= ans;
				}
			}
			if(j==i-1) cout << str[j] << endl;
			else cout << str[j] << " ";
		}
	}
	return 0;
}