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 <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <fstream>
using namespace std;
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string toStr(T x) { ostringstream sout; sout << x; return sout.str();}
typedef vector<int> vi;
typedef vector<vi>  vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n) FOR(i,0,(n)-1)
const double EPS = 1e-12;
const double PI = acos(-1.0);
const int INF = INT_MAX/10;

int main() {
	string s;
	while(getline(cin, s)) {
		REP(i, 26) {
			REP(j, s.length()) {
				if('a' <= s[j] && s[j] <= 'z') {
					s[j]++;
					if('z' < s[j]) {
						s[j] -= 26;
					}
				}
			}

			if(s.find("the") != string::npos) {
				cout << s << endl;
				goto next;
			} else if(s.find("this") != string::npos) {
				cout << s << endl;
				goto next;
			} else if(s.find("that") != string::npos) {
				cout << s << endl;
				goto next;
			}
		}

		next:;
	}

	return 0;
}

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

using namespace std;

void next(string &s) {
    for (int i = 0; i < s.size(); i++) {
        if (isalpha(s[i])) {
            s[i] = (s[i] + 1 - 'a') % 26 + 'a';
        }
    }
}

int main() {
    string s;
    while (getline(cin, s)) {
        while (true) {
            if (s.find("the") != string::npos) break;
            if (s.find("this") != string::npos) break;
            if (s.find("that") != string::npos) break;
            next(s);
        }
        cout << s << endl;
    }
    return 0;
}

C++: //#define _USE_MATH_DEFINES
//#include <cmath>
#include <iostream>
//#include <stdio.h>
//#include <stdlib.h>
//#include <iomanip>
#include <vector>
#include <string>
//#include <algorithm>
//#include <functional>
//#include <time.h>
#include <sstream>

using namespace std;

bool isthe(string str){
	//?????????????????????????????? the this that?????¢??? ????????°ture

	int d1, d2, d3;

	d1 = (str[1] - str[0] + 26) % 26;

	if (d1 != 14){
		return false;
	}
	else{
		d2 = (str[2] - str[0] + 26) % 26;
		if (d2 != 11 && d2 != 15 && d2 != 7){
			return false;
		}
		else{
			if (d2 == 11 && str.size() == 3){
				return true;
			}
			else{
				d3 = (str[3] - str[0] + 26) % 26;
				if (d2 == 15 && d3 == 25) return true;
				if (d2 == 7 && d3 == 26) return true;
			}
		}
	}

	return false;

}


int main(){
	
	string s,sc, buf;
	stringstream ss;
	vector <string> as;
	int dif = 0;


	while (getline(cin, s)){
		dif = 0;
		buf = "";
		sc = "";
		ss.str("");
		ss.clear();

		sc += s;
		for (int i = 0; i < sc.size(); i++){
			if (sc[i] == '.')sc[i] = ' ';
		}
		ss << sc;

		while (ss >> buf){
			//the this that???????´¢
			if (buf.size() == 3 || buf.size() == 4){
				if (isthe(buf)){
					dif = buf[0] - 't';
					break;
				}
			}
		}

		for (int i = 0; i < s.size(); i++){
			if (s[i] >= 'a' && s[i] <= 'z') {
				s[i] -= dif;
				if (s[i] < 'a') s[i] += 26;
				if (s[i] > 'z') s[i] -= 26;
			}
		}

		cout << s << endl;
	}




	return 0;
}

C++: #include<iostream>
#include<string.h>
#include<stdio.h>

int main(){
	char s[100];

	int count = 0;

	gets(s);

	int diff;
	int flag = false;
	//一番最初に｛the,that,this｝がある場合
	diff = s[0] - 't';
	if ((s[1] - diff) == 'h'){
		//printf("%c\n", s[j+1] - diff);
		if ((s[2] - diff) == 'e'){
			//printf("%c\n", s[j + 2] - diff);
			if (s[3] == ' '){
				flag = true;
			}
		}
		else if ((s[2] - diff) == 'a'){
			//printf("%c\n", s[j + 2] - diff);
			if ((s[3] - diff) == 't'){
				//printf("%c\n", s[j + 3] - diff);
				if (s[4] == ' '){
					flag = true;
				}
			}
		}
		else if ((s[2] - diff) == 'i'){
			//printf("%c\n", s[j + 2] - diff);
			if ((s[3] - diff) == 's'){
				//printf("%c\n", s[j + 3] - diff);
				if (s[4] == ' '){
					flag = true;
				}
			}
		}
	}
	
	if (!flag){
		//一番以降に｛the,that,this｝がある場合
		for (int j = 1; j < strlen(s); j++){
			if ((s[j]) == ' '){
				diff = s[j + 1] - 't';
				if ((s[j + 1] - diff) == 't'){
					//printf("diff:%d\n", diff);
					if ((s[j + 2] - diff) == 'h'){
						//printf("%c\n", s[j+1] - diff);
						if ((s[j + 3] - diff) == 'e'){
							//printf("%c\n", s[j + 2] - diff);
							if (s[j + 4] == ' '){
								break;
							}
						}
						else if ((s[j + 3] - diff) == 'a'){
							//printf("%c\n", s[j + 2] - diff);
							if ((s[j + 4] - diff) == 't'){
								//printf("%c\n", s[j + 3] - diff);
								if (s[j + 5] == ' '){
									break;
								}
							}
						}
						else if ((s[j + 3] - diff) == 'i'){
							//printf("%c\n", s[j + 2] - diff);
							if ((s[j + 4] - diff) == 's'){
								//printf("%c\n", s[j + 3] - diff);
								if (s[j + 5] == ' '){
									break;
								}
							}
						}

					}
				}
			}
		}
	}
	//printf("diff:%d\n",diff);
	for (int i = 0;i < strlen(s);i++){
		if (s[i] == ' ' || s[i] == '.')continue;
		s[i] -= diff;
	}

	printf("%s\n",s);

	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define all(c) (c).begin(),(c).end()
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define iter(c) __typeof((c).begin())
#define tr(it,c) for(iter(c) it=(c).begin(); it!=(c).end(); it++)
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define pr(a) cout << (a) << endl
typedef long long ll;
typedef pair<int,int> P;
const int MAX=1000000000;
int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

string change(string s,int k) {
  for(int i=0; i<s.size(); i++) {
    if(s[i]=='.' || s[i]==' ') continue;
    s[i]+=k;
    if(s[i]<'a') s[i]+=26;
    if(s[i]>'z') s[i]-=26;
  }
  return s;
}

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

bool check(string s) {
  for(int i=0; i<3; i++) {
    for(int j=0; j<s.size()-a[i].size(); j++) {
      if(s.substr(j,a[i].size())==a[i]) return true;
    }
  }
  return false;
}

int main() {
  string s;
  while(getline(cin,s)) {
    for(int k=0; k<26; k++) {
      s=change(s,1);
      if(check(s)) {
	pr(s);
	break;
      }
    }
  }
  return 0;
}