Go: package main

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

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 reflect.DeepEqual(infos, []string{}) {
			break
		}
		fmt.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++: #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;
}