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++: #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;

int main() {
	char s[100] = {};
	while (fgets(s,sizeof(s),stdin)) {
		int start = 0, ofs=0,ofs2,chk=1;
		char buf;
		for (int i = 0; s[i] != '\n'; i++) {
			if (s[i] == ' ' || s[i] == '.') {
				if (i - start == 3) {
					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;
						break;
					}
				}
				if (i - start == 4){
					chk = 1	;
					ofs2 = (int)'t' - (int)s[start];
					for (int j = 1; j < 4; 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 != 'a') {
							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;
						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.h>
#include <sstream>
#include <ctype.h>
using namespace std;

string com[3] = {"the", "this", "that"};

string incAlpha (string str, int k) {
    for (int i = 0; i < str.size(); i++) {
        if(isalpha(str[i])) str[i] = ((str[i] + k - 'a') % 26) + 'a'; 
    }
    return str;
}

bool strsrch(string str1, string str2) {
    for (int i = 0; i < str1.size(); i++) {
        if (str1[i] == str2[0]) {
            bool flag = true;
            if (i + str2.size() > str1.size()) flag = false;
            for (int j = 0; j < str2.size() && flag; j++) {
                if (str1[i + j] != str2[j]) flag = false;
            }
            if (flag) return true;
        }
    }

    return false;
}

bool check (string str) {
    for (int i = 0; i < 3; i++) {
        if (strsrch(str, com[i])) return true;
    }
    return false;
}

int main ()
{
    string str;
    while (getline(cin, str)) {
        for (int i = 0; i <= 26; i++) {
            if (check((incAlpha(str, i)))) {
                cout << (incAlpha(str, i)) << endl;
                break;
            }
        }
    }

    return 0;
}

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

bool howMuchWords(string s, string key){
  string::size_type index = s.find(key);
  if(index == string::npos){
    return false;
  }else{
    //???????????£???.
    return true;
  }
}
    

int main(){
  string s;
  int cnt=0;

  while(getline(cin, s)){
    while(true){
      bool flag=false;
      for(int i=0;i<s.length();i++){
	string key1 = s.substr(i,3);
	string key2 = s.substr(i,4);
	if(key1 == "the" || key2 == "this" || key2 == "that"){
	  flag = true;
	  break;
	}
      }
      
      if(flag){
	cout << s << endl;
	continue;
      }
    
      for(int i=0;i<s.length();i++){
	if(s[i] > 'a' && s[i] < 'z'){
	  s[i] -= 'a';
	  s[i] -= 1;
	  if(s[i] < 0){
	    s[i] += 'A' - 'a';
	  }
	  s[i] += 'a';
	}
      }
    }
  }
}

C++: #include "bits/stdc++.h"

using namespace std;

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;

#define dump(x)  cerr << #x << " = " << (x) << endl
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back

char sub(char ch){
	if(ch=='a')return 'z';
	else return ch-1;
}


bool solve(string s){
	string tmp="";
	rep(i,s.size()){
		if(isalpha(s[i])){
			tmp+=s[i];
		}
		else{

			if( tmp=="the" || tmp=="this" || tmp=="that" )return true;

			tmp="";
		}
	}
	return false;
}

int main(){
	string s;
	getline(cin,s);
	while(1){
		rep(i,s.size()){
			if(isalpha(s[i]))s[i]=sub(s[i]);
		}
		if(solve(s))break;
	}
	cout<<s<<endl;
}

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

using namespace std;

int main()
{
  string temp,mainstr;
  
  while(getline(cin,mainstr)){
    temp = mainstr;
    vector<string> str;
    int i,j,k,judge,gosuu=0;
    
    //入力を単語ごとに分割
    i=0;
    while(1){
      int index;
      index = temp.rfind(" ");
      
      if (index==-1){
	str.push_back(temp.substr(index+1));
	temp = temp.substr(0,temp.size()-str[i].size()-1);
	gosuu++;
	break;
      }else{
	str.push_back(temp.substr(index+1));
	temp = temp.substr(0,temp.size()-str[i].size()-1);
	gosuu++;
	i++;
      } 
    }
    
    //単語からピリオドを取り除く
    for(i=0;i<gosuu;i++){
      if (str[i].find(".")!=-1)
	str[i] = str[i].substr(0,str[i].size()-1);
    }
    
    //単語を変換してチェックしていく
    for(i=0;i<gosuu;i++){
      k=1;
      while(1){
	judge = 1;
	
	//単語を1個ずらしたものに変換、このときtを過ぎてたらもうだめ
	for(j=0;j<str[i].size();j++){
	  str[i][j] -= 1;
	  if (str[i][j] < 'a'){
	    judge = 0;
	    break;
	  }
	}

	if (judge == 0) break;
	
	if ((str[i]=="this")||(str[i]=="that")||(str[i]=="the"))break;
	k++;
	
      }
      if (judge==1) break;
    }
    
    //文章の変換
    
    for(i=0;i<mainstr.size();i++){
      if ((mainstr[i]!=' ')&&(mainstr[i]!='.'))
	mainstr[i] -= k;
    }
    
    //変換した文字の出力
    cout << mainstr <<endl;
    
    /*
    for(i=0;i<str.size();i++){
      cout << str[i] <<endl;
    }*/
    
  }

  return 0;
}

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

int main(){
	string str[100];
	int k = 0;
	int zure[100];
	bool flag[100] = {false};
	while(getline(cin, str[k])){
		for(int j = 0; j < 26; j++){
			for(int i = 0; i < str[k].size()-2; i++){
				if(str[k][i] == 't'+j && str[k][i+1] == 'h'+j && str[k][i+2] == 'e'+j){
					zure[k] = j;
					flag[k] = true;
					break;
				}
			}
			if(flag[k] == true){
				k++;
				break;
			}
			for(int i = 0; i < str[k].size()-3; i++){
				if(str[k][i] == 't'+j && str[k][i+1] == 'h'+j && str[k][i+2] == 'i'+j && str[k][i+3] == 's'+j){
					zure[k] = j;
					flag[k] = true;
					break;
				}
			}
			if(flag[k] == true){
				k++;
				break;
			}
			for(int i = 0; i < str[k].size()-3; i++){
				if(str[k][i] == 't'+j && str[k][i+1] == 'h'+j && str[k][i+2] == 'a'+j && str[k][i+3] == 't'+j){
					zure[k] = j;
					flag[k] = true;
					break;
				}
			}
			if(flag[k] == true){
				k++;
				break;
			}
		}
		k++;
	}
	for(int j = 0; j < k; j++){
		for(int i = 0; i < str[j].size(); i++){
			if(str[j][i] >= 'a' && str[j][i] <= 'z'){
				str[j][i] = str[j][i]-zure[j];
				if(str[j][i] < 'a'){
					str[j][i] = str[j][i]+26;
				}
				cout << str[j][i];
			}
			else{
				cout << str[j][i];
			}
		}
	}
}