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 <algorithm>
#include <map>
#include <vector>
#include <string>
#include <cstdio>
#include <cmath>

using namespace std;

int main(void)
{
    string s;
    while(getline(cin, s)) {
        for(int i=0; i<26; i++) {
            for(int j=0; j<(int)s.size(); j++) {
                if('a' <= s[j] && s[j] <='z') {
                    s[j] = (s[j] - 'a' + 1) % 26 + '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 <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;
    while(getline(cin, s)){
    	rep(i, 26) {
	    	rep(j, s.size()) {
	            if('a' <= s[j] && s[j] < 'z') s[j] = s[j] + 1;
	            else if(s[j] == 'z') s[j] = 'a';
	        }
	        if(s.find("the") != string::npos || s.find("this") != string::npos || s.find("that") != string::npos){
                cout << s << endl;
            }
	    }
    }
    return 0;
}

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

using namespace std;

int main(int argc, char const* argv[])
{
	string str;

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

C++: #include <iostream>
#include <string>
#include <vector>
using namespace std;
string caesar(string str,int num){
	string ret;
	char c;
	for(int i=0;i<str.size();i++){
		c=str[i]+(num-26);
		if(c<'a') c+=26;
		ret+=(char)c;
	}
	return ret;
}

char caesarc(char c,int num){
	c+=(num-26);
	if(c<'a') c+=26;
	return c;
}

int main(){
	string str,sts;
	vector<string> ary;
	getline(cin,str);
	str+=" ";
	bool hog[3];
	string tes[3];
	int j;
	for(int i=0;i<26;i++){
		hog[0]=hog[1]=hog[2]=false;
		sts="";
		j=0;
		tes[0]=caesar("this",i);
		tes[1]=caesar("that",i);
		tes[2]=caesar("the",i);
		while(j<str.size()){
			sts="";
			while(str[j]!=' '&&str[j]!='.'){
				sts+=str[j];
				j++;
			}
			for(int k=0;k<3;k++){
				if(tes[k]==sts) hog[k]=true;
			}
			j++;
		}
		if(hog[0]&&hog[1]&&hog[2]){
			for(int k=0;k<str.size()-1;k++){
				if('a'<=str[k]&&str[k]<='z'){
					cout<<caesarc(str[k],26-i);
				}
				else cout<<str[k];
			}
			cout<<endl;
			break;
		}
	}
	return 0;
}

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

char seather(char c, int n) {
  if (c == ' ') return ' ';
  if (c == '.') return '.';

  int nn = c + n;
  if (nn > 122) return char(nn - 122 + 97 - 1);
  return char(nn);
}

string decrypt(string str) {
  for (int i = 0; i < 26; i++) {
    string can = "";
    for (int j = 0; j < str.length(); j++) {
      can += seather(str[j], i);
    }
    if(can.find("the") != string::npos || can.find("this") != string::npos || can.find("that") != string::npos) {
      return can;
    }
  }

  return "could not decrypt" + str;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  string input;
  while(getline(cin, input)) {
    if (input == "") continue;
    cout << decrypt(input) << "\n";
  }

  return 0;
}

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

int main() {
    using namespace std;
    string str;
    getline(cin, str);
    regex pattern(".*(the|this|that).*");
    smatch sm;
    for (int c = 0; c < 'z' - 'a' + 1; ++c) {
        for (size_t i = 0; i < str.size(); ++i) {
            if ('a' <= str[i] && str[i] <= 'z') {
                if (str[i] == 'z') {
                    str[i] = 'a';
                } else {
                    str[i] += 1;
                }
            }
        }
        if (regex_match(str, sm, pattern)) {
            cout << str << endl;
            return 0;
        }
    }
}

C++: #include <iostream>
#include <algorithm>
#include <cctype>
#include <cstdio>
#include <math.h>
#include <map>
#include <queue>
#include <string>
using namespace std;

char ch;
string text;

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

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

int cmp(string s){
	if(s.find("is",0)!=string::npos) return 1;
	if(s.find("the",0)!=string::npos) return 1;
	if(s.find("this",0)!=string::npos) return 1;
	return 0;
}

int main() {
	string s;
	getline(cin,s);
	for(int h=0;h<26;h++){
		for(unsigned int i=0;i<s.length();i++){
				if(s[i]==0x2e||s[i]==0x20) continue;
				s[i]+=1;
				if((int)s[i]>0x7a) s[i]=0x61;
		}if(cmp(s)==1) break;
	} cout<<s<<endl;
	return 0;
}