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 <bits/stdc++.h>

using namespace std;

int main() {
  string str;
  getline(cin, str);
  for (int i = 0; i < 26; ++i) {
    for (char& c : str) {
      if (isalpha(c)) {
        if (c != 'z') ++c;
        else c = 'a';
      }
    }
    if (str.find("that") != string::npos || str.find("this") != string::npos || str.find("the") != string::npos) {
      cout << str << endl;
      return 0;
    }
  }
}

C++: #include<iostream>
#include<cstdio>
#include<cstring>
#include<memory>

using namespace std;

int main(void)
{
    char Cipher[100],ans[100];
	int i=0,count=0;
	while (cin.getline(Cipher,sizeof(Cipher)))
	{
		memcpy(ans,Cipher,sizeof(Cipher));
		while(1)
		{
			char the[10]={'t','h','e'},ths[10]={'t','h','i','s'},that[10]={'t','h','a','t'};
			char *ans;

			if(count==25)break;
			ans=strstr(Cipher,the);
			if(ans!=NULL)break;
			ans=strstr(Cipher,ths);
			if(ans!=NULL)break;
			ans=strstr(Cipher,that);
			if(ans!=NULL)break;
			
			while(Cipher[i]!='\0')
			{
				if(Cipher[i]==' ')i++;
				if(Cipher[i]=='.')break;
				Cipher[i]=Cipher[i]++;
				if(Cipher[i]=='z') Cipher[i]='a';
				i++;
			}
			count++;
			i=0;
		}
		int number=0,i=0;
		if(count!=25)
		{
			while (Cipher[i]!='\0')
			{
				if(Cipher[i]==' ')i++;
				if(Cipher[i]=='.')break;
				number=(Cipher[i]-'a'+count)%26;
				ans[i]=number+'a';
				i++;
			}
		}
		cout<<Cipher<<endl;
		i=0,count=0;
	}
	return 0;
}

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

C++: #include<bits/stdc++.h>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

int main(){
	string s;
	while(getline(cin,s)){
		int size=s.size();
		for(int j=0;;j++){
			string ex=s;
			rep(i,size){
				if(isalpha(ex[i])){
					ex[i]=(char)(((int)ex[i]-'a'+j)%26+'a');
				}
			}
			int cnt=0;
			rep(i,size-2){
				if(ex[i]=='t' && ex[i+1]=='h' && ex[i+2]=='e'){
					cnt++;
					s=ex;
					break;
				}
			}
			rep(i,size-3){
				if(ex[i]=='t' && ex[i+1]=='h' && (ex[i+2]=='i' || ex[i+2]=='a') && (ex[i+3]=='s' || ex[i+3]=='t')){
					cnt++;
					s=ex;
					break;
				}
			}
			if(cnt>=1)break;
		}
		cout<<s<<endl;
	}
	return 0;
}

C++: #include<iostream>
#include<string>
#include<cstring>
int main(){std::string s;while(std::getline(std::cin,s)){char b[81],*p,*c;c=b;strcpy(b,s.c_str());int gap=0;do{p=strtok(c," .\n");if(p!=NULL){int l=strlen(p);if(l>=3&&p[0]-p[1]=='t'-'h'){if(l==3){if(p[0]-p[2]=='t'-'e'){gap='t'-p[0];break;}}else if(l==4){if(p[0]-p[2]=='t'-'i'&&p[0]-p[3]=='t'-'s'){gap='t'-p[0];break;}else if(p[0]-p[2]=='t'-'a'&&p[0]-p[3]==0){gap='t'-p[0];break;}}}}c=NULL;}while(p!=NULL);for(std::string::iterator it=s.begin();it!=s.end();++it){if(*it!=' '&&*it!='.'&&*it!='\n'){std::cout<<static_cast<char>(*it+gap);}else{std::cout<<*it;}}}}

C++: #include<stdio.h>
#include<string.h>
#include<iostream>
#include<algorithm>
#include<queue>
#include<stdlib.h>
#define inf 0x3f3f3f
using namespace std;
int main()
{
    string a;
    while(getline(cin,a))
    {
        while(a.find("the")==-1&&a.find("this")==-1&&a.find("that")==-1)
        {
            for(int i=0;i<a.size();i++)
            {
                if('a'<=a[i]&&a[i]<'z')
                    a[i]++;
                else if(a[i]=='z')
                    a[i]='a';
            }
        }
         cout<<a<<endl;
    }
   return 0;
}