Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	for scanner.Scan() {
		var result string
		line := scanner.Text()
		key := make(map[string]string)

		var i int32
		for ; i < 52; i++ {
			makeKey(key, i)
			result = decode(key, line)

			if strings.Contains(result, "the") {
				break
			} else if strings.Contains(result, "this") {
				break
			} else if strings.Contains(result, "that") {
				break
			}
		}

		fmt.Println(result)
	}
}

func makeKey(key map[string]string, shift int32) {
	for i := 'a'; i <= 'z'; i++ {
		cipher := (i + shift)
		if cipher > 'z' {
			cipher = cipher%'z' + 'a' - 1
		} else if cipher < 'a' {
			cipher = cipher + ('z' - 'a') + 1
		}
		key[string(i)] = string(cipher)
	}
}

func decode(key map[string]string, cipher string) string {
	var result string
	for _, v := range cipher {
		if key[string(v)] != "" {
			result += key[string(v)]
		} else {
			result += string(v)
		}
	}
	return result
}

C++: //
// Created by Tian Wang on 16/4/3.
//
#include <iostream>
#include <string>
#include <vector>

using namespace std;

bool ascii_diff(string x1, string x2) {
    int len = x1.size();
    bool flag = true;
    for(int i = 1; i < len; i++) {
        int diff1 = (int)x1[i] - (int)x1[i-1];
        int diff2 = (int)x2[i] - (int)x2[i-1];
        if(diff1 != diff2) {
            flag = false;
        }
    }
    return flag;
}

int main() {
    string str1 = "the";
    string str2 = "this";
    string str3 = "that";
    string x;
    int len, len_whole;
    int diff=0;
    string word;
    int word_len;
    int sent_len;
    int ascii;
    char k;
    vector<string> input;

    for(string line; getline(cin, line);) {
        len_whole = line.size();
        string x1;
        for(int i = 0; i < len_whole; i++) {
            k = line[i];

            if((int)k >= 97 & (int)k <=122) {
                x1.push_back(k);
            }
            else {
                input.push_back(x1);
                x1.clear();
                x1.push_back(k);
                input.push_back(x1);
                x1.clear();
            }
        }
        x1.clear();
        sent_len = input.size();
        for(int i =0; i < sent_len; i++) {
            x = input[i];
            len = x.size();
            if(len == 3) {
                if(ascii_diff(str1, x)) {
                    diff = (int)x[0] - (int)str1[0];
                }
            }
            else if(len == 4) {
                if(ascii_diff(str2, x)) {
                    diff = (int)x[0] - (int)str2[0];
                }
                else if (ascii_diff(str3, x)) {
                    diff = (int)x[0] - (int)str3[0];
                }
            }
        }
        for(int i = 0; i < sent_len; i++) {
            word = input[i];
            word_len = word.size();
            for(int j = 0; j < word_len; j++) {
                ascii = (int)word[j];
                if(ascii >= 97 & ascii <=122) {
                    cout << (char)(ascii-diff);
                }
                else {
                    cout << (char)ascii;
                }
            }
        }
        cout << endl;
        input.clear();
    }
    return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;

int main()
{
	const string key[] = { "the", "this", "that" };
//	cut here before submit 
//	freopen("testcase.cc", "r", stdin);
	string str = "";
	
	while (getline (cin, str )){
		int len = str.length();
		int i,j;

		for (j = 1; j < 26; ++j){
			string curr = str;
			for (i = 0; i < len; ++i){
				if ( isalpha(curr[i]) ){
					if (isupper(curr[i])){
						curr[i] = (curr[i] - 'A' + j) % 26 + 'A';
					}else if (islower(curr[i])){
						curr[i] = (curr[i] - 'a' + j) % 26 + 'a';
					} // end if
				} // end if
			} // end for
			for (i = 0; i < 3; ++i){
				if ( curr.find(key[i]) != string::npos ){
					cout << curr << endl;
					goto next;
				} // end if
			} // end for
		} // end for
next:
	;
	} // end while
		
	return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;

int main() {
	char s[81] = {};
	while (fgets(s,sizeof(s),stdin)) {
		int start = 0, ofs=0,ofs2,chk=1;
		char buf;
		for (int i = 0; s[i] != '\n'; i++) {
			cout << "start=" << start << endl;
			if (s[i] == ' ' || s[i] == '.') {
				if (i - start == 3) {
					cout << "a\n";
					chk = 1;
					ofs2 = (int)'t' - (int)s[start];
					for (int j = 1; j < 3; j++) {
						buf = s[start + j] + ofs2;
						if (buf > 'z')
							buf -= 26;
						if (buf < 'a')
							buf += 26;
						if (j == 1 && buf != 'h') {
							chk = 0;
							break;
						}
						if (j == 2 && buf != 'e')
							chk = 0;
					}
					if (chk == 1) {
						ofs = ofs2;
						cout << ofs << endl;
						break;
					}
				}
				if (i - start == 4) {
					cout << "b\n";
					chk = 0;
					ofs2 = (int)'t' - (int)s[start];
					for (int j = 1; j < 3; j++) {
						buf = s[start + j] + ofs2;
						if (buf < 'z')
							buf -= 26;
						if (buf > 'a')
							buf += 26;
						if (j == 1 && buf != 'h') {
							chk = 0;
							break;
						}
						if (j == 2 && buf == 'a')
							chk = 2;
						if (j == 2 && buf == 'i')
							chk = 3;
						if (j == 2 && buf != 'i'&&buf != 'i') {
							chk = 0;
							break;
						}
						if (j == 3 && chk == 2) {
							if (buf == 't')
								chk = 1;
							else {
								chk = 0;
								break;
							}
						}
						if (j == 3 && chk == 3) {
							if (buf == 's')
								chk = 1;
							else {
								chk = 0;
								break;
							}
						}
					}
					if (chk == 1) {
						ofs = ofs2;
						cout << ofs << endl;
						break;
					}
				}
				start = i + 1;
			}
		}
		for (int i = 0; s[i] != '\n'; i++) {
			if (s[i] != ' '&& s[i]!='.') {
				s[i] += ofs;
				if (s[i] > 'z')
					s[i] -= 26;
				if (s[i] < 'a')
					s[i] += 26;
			}
		}
		cout << s;
	}
	return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
 
int main(void) {

  string str;
   
  while(getline(cin, str)) {
    while(1) {
      for(int i=0; i<str.length(); i++) {
          if(str[i] != ' ' && str[i] != '.') {
              if(str[i] != 'z'){
                        str[i] += 1;
                    }else{
                        str[i] = '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 <algorithm>
#include<string>
#include<vector>
int main() {
	std::string s,a;
	std::getline (std::cin , s);
	int p = s[0] - 't';
	for (int i = 0; i < s.size(); ++i) {
		if (s[i] != ' ' &&s[i]!= '.') {
			if (s[i] - p < 'a') {
				a += 'z' - ('a' - (s[i] - p)-1);
			}
			else a += s[i] - p;
		}
		else a += s[i];
	}
	std::cout << a<< std::endl;
	return 0;
}

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

int cmp(string s){
	if(s.find("that",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||s[i]==0x0a) continue;
				s[i]+=1;
				if((int)s[i]>0x7a) s[i]=0x61;
		}if(cmp(s)==1) break;
	} cout<<s<<endl;
	return 0;
}