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

string caesar(string a,int n)
{
	for(int i=0;i<a.length();i++){
		if(isalpha(a[i])){
			a[i]=((a[i]+n>122)?a[i]-26+n:a[i]+n);
		}
	}
	return a;
}

int main()
{
	string a,tmp;
	while(cin>>tmp){
		a+=tmp;
		a+=' ';
	}
	
	for(int i=0;i<26;i++){
		string tmp=caesar(a,i);
		if(tmp.find("the")!=string::npos || tmp.find("that")!=string::npos || tmp.find("this")!=string::npos){
			cout<<tmp<<endl;
			break;
		}
	}
	return 0;
}

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

using namespace std;

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

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

C++: #include<string>
#include<vector>
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<sstream>
#include<functional>
#include<map>
#include<stack>
#include<set>
#include<cmath>

#define REP(i,s,e) for(int i=int(s);i<=int(e);i++)
#define rep(i,n) for(int i=0;i<int(n);i++)

#define EPS 1e-6

using namespace std;

bool f(string a){

string::size_type p=a.find("the");
string::size_type q=a.find("this");
string::size_type r=a.find("that");
if(p!=string::npos || q!=string::npos || r!=string::npos)
return true;
else return false;

	}

int main(){

   string s,s1;

   while(getline(cin,s)){

	int n=s.size();

		rep(j,26){
		rep(i,n){
		if('a'<=s[i] && s[i]<='y') s[i]++;
		else if(s[i]=='z') s[i]='a';
		}

		if(f(s)){ cout << s << endl; break; }

		}

	}

    return 0;
}

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

int main(){
  string s;

  while(getline(cin, s)){
    int flag = 0;
    
    while(true){

      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 = 1;
	}
      }
      
      if(flag){
	break;
      }else{
	
    
	for(int i=0;i<s.length();i++){
	  if(s[i] >= 'a' && s[i] <= 'z'){
	    // s[i] -= 'a';
	    // s[i] += 1;
	    // s[i] = s[i]%('A'-'a');
	    // s[i] += 'a';

	    s[i] -= 'a' - 'A';
	    s[i] = ('A' + s[i] - 'A' + 26 + 1)%26;
	    s[i] += 'a' - 'A';
	    
	  }else{
	    continue;
	  }
	}
      }
    }
    cout << s << endl;
  }
  return 0;
}

C++: #include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <cmath>
#include <string.h>
using namespace std;

#define FOR(i,s,e) for (int i = int(s); i != int(e); i++)
#define REP(i,e) for (int i = 0; i != int(e); i++)
#define FORIT(i, A) for (auto i : A)
#define ISEQ(c) (c).begin(), (c).end()
#define PRINT(x) cout << (x) << endl
#define SZ(x) ((int)(x).size())

int check(const char* word)
{
	if ((word[1] - word[0]) % 26 != ('h'-'t'))
		return -1;

	if ((word[2] - word[1]) % 26 == ('e'-'h') && 
		(word[3] == ' ' || word[3] == '\0' || word[3] == '\n'))
	{
		return (word[0] - 't' + 26) % 26;
	}
	if ((word[2] - word[1]) % 26 == ('a'-'h') && 
		(word[3] - word[2]) % 26 == ('t'-'a') &&
		(word[4] == ' ' || word[4] == '\0' || word[4] == '\n'))
	{
		return (word[0] - 't' + 26) % 26;
	}
	if ((word[2] - word[1]) % 26 == ('i'-'h') && 
		(word[3] - word[2]) % 26 == ('s'-'i') && 
		(word[4] == ' ' || word[4] == '\0' || word[4] == '\n'))
	{
		return (word[0] - 't' + 26) % 26;
	}
	return -1;
}

int main(int argc, char const *argv[])
{
	string s;
	if (getline(std::cin, s))
	{
		int len = s.length();
		int d = check(&s[0]);
		int i = 3;
		while (d == -1)
		{
			while(i < len && s[i] != ' ')
				i++;
			if (i == len) break;
			i++;
			d = check(&s[i]);
		}
		REP(j, len)
		{
			if (s[j] >= 'a' && s[j] <= 'z')
			{
				s[j] = (s[j] - 'a' - d + 26) % 26 + 'a';
			}
		}
		std::cout << s << std::endl;
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
string text;
int i,n;
int main(){
	while(getline(cin,text)){
		n=1;
		while(n!=27){
			i=0;
			while(i!=text.size()){
				if('a'<=text[i]&&text[i]<'z'){
					text[i]+=1;
				}else if(text[i]=='z'){
					text[i]='a';
				}
				i++;
			}
			if(text.find("the")!=-1)break;
			if(text.find("this")!=-1)break;
			if(text.find("that")!=-1)break;
			n++;
		}
		cout <<text<<endl;
	}
	return 0;
}

C++: #include <stdio.h>
using namespace std;
int main() {
	string w[3]={"the","this","that"},st;
	int wn[3]={3,4,4},k,i,j,s,f;
	while(true) {
    k=0; 
	getline(cin,st);
	while(k<st.size()) {
		for (i=0;i<3;i++) {
			s=0; f=0;
			if (st.size()<k+wn[i]) break;
			for (j=0;j<wn[i]-1;j++) if ((w[i][j]-w[i][j+1])==(st[k+j]-st[k+j+1])) s++;
			if (s==wn[i]-1)  { f=1; i=5;}
		}
		if (f==1) break;
		for (k;st[k]>='a' && st[k]<='z' && k<80; k++);
		k++;
	}
	if (f==0) cout << st; else {
		for (i=0;i<st.size();i++) 
			if ((st[i]>='a' && st[i]<='z')) cout << (char)(((st[i]-st[k]+'t')-97+26) % 26 + 97) ; 
		    else cout << st[i];
	}
	cout << endl;
	}
	return 0;
	}

C++: #include <stdio.h>
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

string f(const string& s, int k) {
    string t;
    rep (i, s.size()) {
        if (islower(s[i])) t += (char)((s[i]-'a'+k)%26+'a');
        else t += s[i];
    }
    return t;
}

bool ok(const string& t) {
    if (t.find("the") != string::npos) return true;
    if (t.find("this") != string::npos) return true;
    if (t.find("that") != string::npos) return true;
    return false;
}

int main() {
    string s;
    while (getline(cin, s)) {
        if (s.size() > 0 && s[s.size()-1] == '\r') s.resize(s.size()-1);
        rep (i, 26) {
            const string t = f(s, i);
            if (ok(t)) {
                cout << t << endl;
                break;
            }
        }
    }
    return 0;
}

C++: #include <iostream>
#include <cstring>
#include <cstdio>
#include <cctype>
#define N 100
using namespace std;

void hukugou(char str2[]){
  int i;

  while(1){

    for(i = 0;str2[i] != '\0';i++){
      if(str2[i] != ' ' && str2[i] != '\n' && str2[i] != '.'){
	str2[i] = (str2[i] - 'a' + 1) % 26 + 'a';
      }
    }

    if(strstr(str2, "the") != NULL || strstr(str2, "this") != NULL || strstr(str2, "that") != NULL){
      cout << str2;
      break;
    }
  }

}

int main(){
  char str[N];

  fgets(str, sizeof(str), stdin);

  hukugou(str);

  return 0;
}