Go: package main

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

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 len(infos) == 0 {
			break
		}
		// 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 <string>
using namespace std;

bool decision(string input){
	for(int i = 0; i < input.size()-3; i++){
		if((input[i] == 't' && input[i+1] == 'h' && input[i+2] == 'e') ||
			(input[i] == 't' && input[i+1] == 'h' && input[i+2] == 'i' && input[i+3] == 's') ||
			(input[i] == 't' && input[i+1] == 'h' && input[i+2] == 'a' && input[i+3] == 't')){
			return true;
		}
	}
	return false;

}

int main(){
	string input;
	getline(cin, input);

	while(getline(cin, input);){
		for(int i = 0; i < input.size(); i++){
			if('a' <= input[i] && input[i] <= 'z'){
				if(input[i] != 'z'){
					input[i] += 1;
				}else{
					input[i] = 'a';
				}
			}
		}
		if(decision(input)) cout << input << endl;;
	}

	return 0;
}

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

// determine whether it is "the","this" or "that"
char is_article(string w) {
	char sh = '\0'; // shift defaults to 0
	if (w.size() == 3) {
		sh = 't' - w.front();
		for_each(w.begin(),w.end(),[sh](char &c){c += sh;});
		if (w != "the") {
			sh = '\0';
		}
	} else if (w.size() == 4) {
		sh = 't' - w.front();
		for_each(w.begin(),w.end(),[sh](char &c){c += sh;});
		if (w != "this" && w != "that") {
			sh = '\0';
		}
	}
	return sh;
}

int main() {
	string s;
	while (getline(cin,s)) {
		istringstream stream(s);
		string w;
		char sh;
		while (stream >> w) {
			if ((sh = is_article(w)) != '\0') {
				break;
			}
		}
		for_each(s.begin(),s.end(),[sh](char &c){c += c >= 'a' && c <= 'z' ? sh : '\0';});
		cout << s << endl;
	}
}

C++: #include<iostream>
#include<string>
int main(){
	std::string str;
	while(std::getline(std::cin,str)){
	for(int i=0;i<str.size();i++){
		if(str[i]!=' ')str[i]+=1;
	}
	std::cout<<str<<std::endl;
	}
	return 0;
}

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

using namespace std;

int main(){
  string s;
  while(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>
#include <string.h>
using namespace std;
int main(){
	string alpha = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz";
	string str;
	while( cin >> str, str ){
		getline( cin, str );
		for( int a = 0; a < 26; a++ ){
			for( int i = 0; i < str.length(); i++ ){
				for( int j = 0; j < alpha.length(); j++ ){
					if( str[i] == alpha[j] ){
						str[i] = alpha[j + 1];
						break;
					}
				}
			}
		/*char word = strtok( str.c_str(), " " );
		if( word == "the" || word == "that" || word == "this" ) break;
		while( word == NULL ){
			word = strtok( NULL, ' ' );
			if( word == "the" || word == "that" || word == "this" ) goto end;
		}*/
			if( str.find("the") != string::npos || str.find("this") != string::npos || str.find("that") != string::npos ){
				break;
			}
		}
		cout << str << endl;
	}
}

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

using namespace std;

void solve()
{
	string str;
	getline(cin, str);
	string word;
	int n = str.size();
	for(int j = 1; j < 26; ++j)
	{
		word.clear();
		for(int i = 0; i < n; ++i)
		{
			if('a' <= str[i] && str[i] <= 'z')
			{
				word += (str[i] + j -'a') % 26 + 'a';
			}
			else
			{
				word += str[i];
			}
		}
		if(word.find("this") != -1 || word.find("the") != -1 || word.find("that") != -1)
		{
			cout << word << endl;
		}
	}
}

int main()
{
	solve();
	return(0);
}

C++: #include <iostream>
#include <string>
using namespace std;
int main(){
	string a;
	while(getline(cin,a)){
	int k=0;
	while(true){
		int check=0;
		if(k>26)
			break;
		for(int j=0;j<a.size();j++){
			if(isalpha(a[j])!=0)
				a[j]++;
			if(a[j]>'z')
				a[j]-=26;
		}
		for(int i=0;i<a.size()-2;i++){
			if(a[i]=='t'&&a[i+1]=='h'&&a[i+2]=='e'&&check==0){
				for(int i=0;i<a.size();i++)
		            cout<<a[i];
	            cout<<endl;
				check=1;
			}
			if(a[i]=='t'&&a[i]=='h'&&a[i]=='i'&&a[i]=='s'&&check==0){
				for(int i=0;i<a.size();i++)
		            cout<<a[i];
	            cout<<endl;
				check=1;
			}
			if(a[i]=='t'&&a[i]=='h'&&a[i]=='a'&&a[i]=='t'&&check==0){
				for(int i=0;i<a.size();i++)
		            cout<<a[i];
	            cout<<endl;
				check=1;
			}
		}
		k++;
	}
	}
	return 0;
}

C++: #include<algorithm>
#include<functional>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<string>
#include<sstream>
#include<iostream>
#include<iomanip>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<bitset>

#define all(c) (c).begin(), (c).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)
#define fr first
#define sc second

typedef unsigned long long ull;
typedef long long ll;

const int INF=100000000;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

using namespace std;

typedef pair<int ,int > P;

char ss[1024];
int n;

bool check()
{
	//the, this, that
	rep(i,n-4)
	{
		if(ss[i]=='t'&&ss[i+1]=='h'&&ss[i+2]=='i'&&ss[i+3]=='s') return true;
		if(ss[i]=='t'&&ss[i+1]=='h'&&ss[i+2]=='a'&&ss[i+3]=='t') return true;
		if(ss[i]=='t'&&ss[i+1]=='h'&&ss[i+2]=='e') return true;

	}
	return false;

}

void f()
{

	rep(i,n)
	{
		if(ss[i]=='\n') break;
		if(ss[i]==' '||ss[i]=='.') continue;
		char c=ss[i];
		c++;
		c-=19;
		c=c%26;
		ss[i]=(c+'a');
	}

}
int main()
{
	while(fgets(ss,sizeof(ss),stdin)!=NULL)
	{
		n=strlen(ss);
		//[97,122]
		//%97
	
		rep(i,26)
		{
			if(check())
			{
				printf("%s",ss);
				goto go;
			}
			f();
			//cout<<ss;
		}
go:;
	}
	
	return 0;
}