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++: #include <iostream>
#include <string>
#include <cstdlib>

using namespace std;

int main(){
  string s;
  getline(cin,s);
  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<string>
using namespace std;

int main() {
	string sa;
	while (getline(cin, sa), sa != "END OF INPUT") {
		int a = sa.size();
		while (1) {
			for (int i = 0; i < a; i++) {
				if (sa[i] > 96 && sa[i] < 123) {
					sa[i] += 1;
				}
					if (sa[i] == 123){
						sa[i] -= 26;
					}				
			}
			size_t za=sa.find("this"||"that"||"the");
			if (za != string::npos) {
				break;
			}
		}
		cout << sa << endl;
	}
	return 0;
}

C++: 
#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <vector>
#include <map>
#include <utility>
#include <complex>
#include <stack>

using namespace std;

typedef complex<double> P;

int main(){

	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'){
					char c = (s[j] - 'a' + 1) % 26 + 'a';
					s[j] = c;
				}
			}

			if(s.find("the") != string::npos || s.find("this") != string::npos || s.find("that") != string::npos)
				break;
		}

		cout << s << endl;
	}

	return 0;
}

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

using namespace std;

int main()
{
	string s;
	int pl;
	while(getline(cin,s))
	{
		if(s=="\n" && s=="EOF") 
			break;

		pl = 0;

		for(int i =-30;i<30;i++)
		{
			for(int j = 0; j < s.size()-3; j++)
			{
				if(s[j]+i=='t' &&s[j+1]+i == 'h' && s[j+2]+i == 'e')
				{
					pl = i;
					break;
				}

				if(j==s.size()-1) 
					break;

				if(s[j]+i=='t' &&s[j+1]+i == 'h' && s[j+2]+i == 'a' && s[j+3]+i=='t')
				{
					pl = i;
					break;
				}

				if(s[j]+i=='t' &&s[j+1]+i == 'h' && s[j+2]+i == 'i' && s[j+3]+i=='s')
				{
					pl = i;
					break;
				}
			}

			if(pl!=0) 
				break;
		}

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

		cout<<s<<endl;
	}
}

C++: #include<cstdio>

using namespace std;



char shiftch(char p, int n){
	int t;
	if('A'<= p && p <='Z'){
		p-='A';
		if(n<0) n+=26;
		p+=n;
		p%=26;
		p+='A';
		return p;
	}
	else if('a'<= p && p <='z'){
		p-='a';
		if(n<0) n+=26;
		p+=n;
		p%=26;
		p+='a';
		return p;
	}
	else return p;
}

int main(){

	int	i, j, n;
	char in[1000], *p, *tp;
	p= in;

	scanf("%[^\n]", in);
	for(n=0; 16<=in[n] && in[n]<=126; n++);

	while(1){
		tp=p;
		for(i=0; *(p++)!=' ';	i++);
		if(i==3||i==4){

			j=*tp-'t'; if(*(tp+1)=='h'+j) break;
			j=*tp-'T'; if(*(tp+1)=='h'+j){
			j+='a'-'A';
			break;
			}
		}
	}
	for(i=0; i<n; i++)	in[i]=shiftch(in[i],-j);

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

	return 0;
}

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

int main(void){
	char data[100];
	char s1[]="the",
		 s2[]="this",
		 s3[]="that";
	int i,cnt=0;
	char *p;

	while((fgets(data,100,stdin))){
		while(cnt<=26){
			p=strstr(data,s1);
			if(p)
				break;
			p=strstr(data,s2);
			if(p)
				break;
			p=strstr(data,s3);
			if(p)
				break;
			for(i=0;i<100;i++){
				if(data[i]=='\0')
					break;
				if('a'<=data[i] && data[i]<='y')
					data[i]++;
				if('z'==data[i])
					data[i]='a';
			}
			cnt++;
		}
		cnt=0;
		printf("%s\n",data);
	}
	return 0;
}

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

using namespace std;

string decStr(string str, int n) {
  for(int i = 0; i < str.length(); i++) {
    if(!isalpha(str[i])) continue;
    str[i] = (char)(  ((int)str[i]-(int)'a'+n)%26  + (int)'a'  );
  }
  return str;
}

int main(void) {
  string str;

  while(getline(cin, str)) {
    string ans;
    for(int i = 0; i < 26; i++) {
      ans = decStr(str, i);
      if(ans.find("the") != string::npos) break;
      if(ans.find("this") != string::npos) break;
      if(ans.find("that") != string::npos) break;
    }
    cout << ans << endl;
  }
  return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<cmath>
#include<vector>
#include<list>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<string>
#include<utility>
#include<algorithm>
#include<functional>
#include<deque>
#include<string.h>
#include<ctype.h>
#include<time.h>
#include<stdlib.h>
using namespace std;
 
char c[85];
 
bool search_th(){
  bool f = false;
  for (int i = 0; i < strlen(c); i++){
    if ((c[i] == 't' && c[i+1] == 'h' && c[i+2] == 'e') ||
        (c[i] == 't' && c[i+1] == 'h' && c[i+2] == 'i' && c[i+3] == 's') ||
        (c[i] == 't' && c[i+1] == 'h' && c[i+2] == 'a' && c[i+3] == 't')){
          f = true;  break;
    }
  }
  return f;
}
 
int main(){
  while (cin.getline(c, sizeof(c))){
    while (1){
      if (search_th() == true){
        cout << c << endl;
        break;
      }
      for (int j = 0; j < strlen(c); j++){
        if (c[j] >= 'a' && c[j] <= 'y') c[j]++;
        else if (c[j] == 'z')                c[j] = 'a';
      }
    }
    for (int i = strlen(c); i < 85; i++){
      c[i] = '\0';
    }
  }
  return 0;
}

C++: #include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <string>
#include <algorithm>
#include <string>
#include <climits>
#include <iomanip>
#include <utility>

#define REP(i, n) for (int (i) = 0; (i) < (int)(n); (i)++)
#define REG(i, a, b) for (int (i) = ((int)(a)); (i) < ((int)(b)); i++)
#define ALL(V) (V).begin(), (V).end()
#define PRINT(STR) cout << (STR) << endl
#define DEBUG(X) cerr << X << " (" << __LINE__ << ", " << __func__ << " )" << endl;

typedef long long ll;
using namespace std;

int main() {
	cin.tie(0); //?????±?????????????????????
	ios::sync_with_stdio(false); //printf??¨??±??????????????????
	string str;
	while (getline(cin, str)) {
		for (int i = -26; i <= 26; i++) {
			string newstr = str;
			for (int j = 0; j < str.size(); j++) {
				if ('a' <= newstr[j] && newstr[j] <= 'z') {
					newstr[j] = str[j] + i;
					if (newstr[j] < 'a') {
						newstr[j] -= 'a';
						newstr[j] += 123;
					} else if (newstr[j] > 'z') {
						newstr[j] -= 'z' + 1;
						newstr[j] += 'a';
					}
				}
			}
			//cerr << newstr << endl;
			if (newstr.find("the", 0) != string::npos ||
					newstr.find("this", 0) != string::npos ||
					newstr.find("that", 0) != string::npos) {
				cout << newstr << endl;
				break;
			}
		}
	}
	return 0;
}