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++: #ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#ifdef __GXX_EXPERIMENTAL_CXX0X__
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#ifdef __GXX_EXPERIMENTAL_CXX0X__
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

using namespace std;


int main ()
{
	string str , str2;
	vector<string>data;
	while( getline ( cin , str2 ) )
	{

		bool f = 0;
		for( size_t i = 0; i < 26; i++ )
		{

			for( auto &x : str2 )
			{
				if( x <= 'z'&&'a' <= x )
				{
					x -= 'a';
					x += 1;
					x %= 26;
					x += 'a';
				}
			}

			if( str2.find ( "the" ) != string::npos || str2.find ( "this" ) != string::npos || str2.find ( "that" ) != string::npos )
			{
				cout << str2 << endl;
				break;
			}


		}
	}
}

C++: #include <stdio.h>
int check(int a,int b,int c)
{
    //printf("[%d][%d][%d]\n",a,b,c);
    if(a != 14)return 0;
    else if(b == 23)return 1;
    else if(b == 1 && c == 10)return 1;
    else if(b == 19 && c == 19)return 1;
    else return 0;
}

int main()
{
    int longth,mem = 0;
    while(1)
    {
        char str[90] = {0};
        int mem1[90] = {0},mem2[90] = {0};
        if(scanf("%c",&str[0]) == -1)return 0;
        if(str[0] >= 'a' && 'z' >= str[0])mem1[0] = str[0] - 'a' + 1;
        for(int i = 1; i < 80; i++)
        {
            scanf("%c",&str[i]);
            if(str[i] == '\n')break;
            longth = i;
            if(str[i] >= 'a' && 'z' >= str[i])mem1[i] = str[i] - 'a' + 1;
        }
        for(int i = 0; i < longth; i++)
        {
            if(mem1[i] == 0);
            else if(mem1[i + 1] != 0)
            {
                if(mem1[i] <= mem1[i + 1])mem2[i] = mem1[i + 1] - mem1[i];
                else mem2[i] = 26 - mem1[i] + mem1[i + 1];
            }
        }
        /*for(int i = 0; i < longth; i++)
        {
            printf("[%d]",mem2[i]);
        }
        printf("\n");*/
        for(int i = 0; i < longth; i++)
        {
            //if(mem2[i] == 0);
            /*else */if(i == 0)/*printf("[%d]\n",i);*/if(check(mem2[i],mem2[i + 1],mem2[i + 2]))if(mem1[i] <= 20)mem = 20 - mem1[i];else mem = 26 - mem1[i] + 20;
            //else if(mem2[i - 1] == 0)/*printf("{%d}\n",i);*/if(check(mem2[i],mem2[i + 1],mem2[i + 2])if(mem1[i] <= 20)mem = 20 - mem1[i];else mem = 26 - mem1[i] + 20;
            //else printf("no\n");
        }
        //printf("{{%d}}\n",mem);
        for(int i = 0; i < longth + 1; i++)
        {
            if(str[i] >= 'a' && 'z' >= str[i])printf("%c",(str[i] - 'a' + mem) % 26 + 'a');
            else printf("%c",str[i]);
        }
        printf("\n");
    }
}

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] >='a' && sa[i] <='z') {
					sa[i] +=1;
				}
					if (sa[i]>'z'){
						sa[i] -= 26;
					}				
			}
			int za=(int)sa.find(" this "||" that "||" the ");
			if (za != -1) {break;}
		}
		cout << sa << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cctype>
#include <cstdio>
#include <math.h>
#include <map>
#include <queue>
#include <string>
using namespace std;

char ch;
string text;

int main() {
    while(getline(cin,text)){
    	for(int i=0;i<26;i++){
    		for(int j=0;j<text.size();j++){
    			if(text[j]>='a'&&text[j]<='y')text[j]+=1;
    			else if(text[j]=='z')text[j]='a';
    		}
    		int p=text.find("the"),q=text.find("this"),r=text.find("that");
    		if(p!=string::npos||q!=string::npos||r!=string::npos){
    			cout<<text<<endl;
    			break;
    		}
    	}
    }
}

C++: #include<stdio.h>
#include<iostream>
#include<math.h>
#include<string>
using namespace std;
int main(){
	
	char s[1000];
	while(cin.getline(s,1000)){
		for(int i=0;s[i]!='\0';i++){
			if(((s[i]-s[i+1]+26)%26=='t'-'h')&&((((s[i+1]-s[i+2]+26)%26=='h'-'i')&&((s[i+2]-s[i+3]+26)%26=='i'-'s'))||((s[i+1]-s[i+2]+26)%26=='h'-'e')||(((s[i+1]-s[i+2]+26)%26=='h'-'a')&&((s[i+2]-s[i+3]+26)%26=='a'-'t')))){
				for(int j=0;s[j]!='\0';j++){
					if((s[j]!=' ')&&(s[j]!='.')&&(s[j]!='\n')){
						putchar((s[j]+'t'-s[i]-'a'+26)%26+'a');
					}else{
						putchar(s[j]);
					}
				}cout<<endl;
				break;
			}
		}
	}
	return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <vector>
#include <string>
#include <algorithm>
#include <sstream>
#include <stdlib.h>

using namespace std;

int main(void){
	
	while( true ) {
		if( cin.eof() ) break;
		string str;
		string ans;
		getline( cin, str );

		for( int i = 0; i < 26; i++ ) {
			string newstr;
			newstr = str;
			for( int j = 0; j < str.length(); j++ ) {
				if( str[j] < 'a' || str[j] > 'z' ) continue;
				else {
					newstr[j] = ( str[j] - 'a' + i ) % 26 + 'a';
				}
			}
			if( newstr.find("the") != string::npos || newstr.find("this") != string::npos || newstr.find("that") != string::npos ) {
				ans = newstr;
				break;
			}
		}
		cout << ans;
	}

	
    return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<memory>
#include<array>
#include<vector>
#include<queue>
#include<list>
#include<stack>
#include<algorithm>
#include<cmath>

using namespace std;

int chipher( string& s )
{
  for ( auto& c : s )
    {
      if ( c >= 'a' && c <= 'y' )
        ++c;
      else if ( c == 'z' )
        c = 'a';
    }
  return 0;
}

int main()
{
  
  string x;

  getline(cin, x);

  for ( int i = 0; i < 26; ++i )
    {
      if ( x.find( "the" ) != string::npos )
        cout << x << endl;
      else if ( x.find( "this" ) != string::npos )
        cout << x << endl;
      else if ( x.find( "that" ) != string::npos )
        cout << x << endl;
      chipher( x );
    }
  
  return 0;
}