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

int main() {
	char s[100] = {};
	while (fgets(s,sizeof(s),stdin)) {
		int start = 0, ofs=0,ofs2,chk=1;
		int buf;
		for (int i = 0; s[i] != '\n'; i++) {
			if (s[i] == ' ' || s[i] == '.') {
				if (i - start == 3) {
					chk = 1;
					ofs2 = (int)'t' - (int)(s[start]);
					for (int j = 1; j < 3; j++) {
						buf = (int)s[start + j] + ofs2;
						if (buf > (int)'z')
							buf -= 26;
						if (buf < (int)'a')
							buf += 26;
						if (j == 1 && buf != (int)'h') {
							chk = 0;
							break;
						}
						if (j == 2 && buf != (int)'e')
							chk = 0;
					}
					if (chk == 1) {
						ofs = ofs2;
						break;
					}
				}
				if (i - start == 4){
					chk = 1	;
					ofs2 = (int)'t' - (int)s[start];
					for (int j = 1; j < 4; j++) {
						buf = (int)s[start + j] + ofs2;
						if (buf > (int)'z')
							buf -= 26;
						if (buf < (int)'a')
							buf += 26;
						if (j == 1 && buf != (int)'h') {
							chk = 0;
							break;
						}
						if (j == 2 && buf == (int)'a')
							chk = 2;
						if (j == 2 && buf == (int)'i')
							chk = 3;
						if (j == 2 && buf != (int)'i'&&buf != (int)'a') {
							chk = 0;
							break;
						}
						if (j == 3 && chk == 2) {
							if (buf == (int)'t')
								chk = 1;
							else {
								chk = 0;
								break;
							}
						}
						if (j == 3 && chk == 3) {
							if (buf == (int)'s')
								chk = 1;
							else {
								chk = 0;
								break;
							}
						}
					}
					if (chk == 1) {
						ofs = ofs2;
						break;
					}
				}
				start = i + 1;
			}
		}
		for (int i = 0; s[i] != '\n'; i++) {
			int buf;
			if (s[i] != ' '&& s[i]!='.') {
				buf = (int)s[i] + (int)ofs;
				if (buf > (int)'z')
					buf -= 26;
				if (buf < (int)'a')
					buf += 26;
				s[i]=(char)buf;
			}
		}
		cout << s;
	}
	return 0;
}

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

int main(){

	string code;
	string word;
	bool found;

	while( getline(cin, code) ){
		found = false;

		for( int j=0;j<25;j++ ){


			for( int i=0;i<code.length();i++ ){
				if( code[i] >= 'a' && code[i] <= 'z' ){
					code[i] += 1;
					if(code[i]=='z'+1)code[i]='a';
				}
			}


			word = "";
			for( int i=0;i<code.length()+1;i++){
				if(code[i] >= 'a' && code[i] <= 'z' )
					word += code[i];
				else{
					if( word == "the" || word == "this" || word == "that" ){
						found = true;
					}
					word = "";
				}
				
			}
			if(found)break;
			
			
		
		}
		cout << code << " " << endl;

	}
	return 0;

}

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

int main(){

	string code;

	while( getline(cin, code) ){

		for( int j=0;j<25;j++ ){
			for( int i=0;i<code.length();i++ ){
				if( code[i] >= 'a' && code[i] <= 'z' ){
					code[i] += 1;
					if(code[i]=='z'+1)code[i]='a';
				}
			}
			if(code.find("the") != -1 || code.find("this") != -1 || code.find("that") != -1)
				break;		
		}
		cout << code << endl;
	}
	return 0;

}

C++: #include<iostream>
using namespace std;
int main()
{
	string s;
	for(;getline(cin,s);)
	{
		cin.ignore();
		bool f=0;
		for(;!f;)
		{
			for(int i=0;i<s.size();i++)
			{
				if(s[i]>='a'&&s[i]<='z')
				{
					s[i]--;
					if(s[i]<'a')s[i]='z';
				}
			}
			string t[3]={"the","this","that"};
			for(int i=0;!f&&i<3;i++)
			{
				for(int j=0;!f&&j+t[i].size()<s.size();j++)
				{
					if(s.substr(j,t[i].size())==t[i])
					{
						cout<<s<<endl;
						f=1;
					}
				}
			}
		}
	}
}

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

int main(){

	string code;

	while( getline(cin, code) ){

		for( int j=0;j<=26;j++ ){
			for( int i=0;i<code.size();i++ ){
				if( code[i] >= 'a' && code[i] <= 'z' ){
					code[i] += 1;
					if(code[i]=='z'+1)code[i]='a';
				}
			}
			if(code.find("the ") != -1 || code.find("this") != -1 || code.find("that") != -1)
				break;		
		}
		cout << code << endl;
	}
	return 0;

}

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

using namespace std;

char data[26]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
char trans[100];
char mozi;
int position=0;
int zoom;
int first_check=0,first_position=0;
int now;
char result;
int flag = 0;

int main(){
	while(flag == 0){
		scanf("%c",&mozi);
		if(first_check == 0)

		for(int i=0;i<26 && first_check == 0;i++){
			if(mozi == data[i]){
				first_position = i;
				zoom = first_position - 19;
				first_check = 1;
				break;
			}
		}




		if(mozi == ' ' || mozi == '.' || mozi == '\n'){
			if(mozi == ' ' || mozi == '.'){
				trans[position] = mozi;
				position++;
			}

			if(mozi == '\n'){
				//trans[position] = '\n';
				printf("%s",trans);
				first_check = 0;
				position = 0;
				memset(trans,'\0',sizeof(trans));
				flag = 1;
			}
		}else{
			for(int i=0;i<26;i++){
				if(data[i] == mozi){
					now = i;
					break;
				}
			}

			trans[position] = data[now - zoom];
			position++;

		}
	}
}

C++: #include <stdio.h>
#include <string.h>

int main(void){
    char buf[128];
    bool found;
    
    gets(buf);
    for(int i=0; i<26; i++){
        found = false;
        if (strstr(buf, "th")){
            found = (strstr(buf,"the") != NULL);
            found |= (strstr(buf,"this") != NULL);
            found |= (strstr(buf,"that") != NULL);
        }
        if (found) break;
        for (char *p = buf; *p != '\0'; p++){
            if (*p >= 'a' && *p <= 'z'){
                *p = (*p - 'a' + 1) % 26 + 'a';
            }
        }
    }
    printf("%s\n",buf);
    
    return 0;
}

C++: #include<string>
#include<iostream>
#include<algorithm>
using namespace std;
string henkan(string a)
{
	for (int i = 0; i < a.size(); i++)
	{
		if (a[i] != ' '&&a[i] != '.')
		{
			if (a[i] == 'z')a[i] = 'a';
			else 
				a[i] += 1;
		}
	}
	return a;
}
bool check(string a)
{
	string x[3] = { "the", "this", "that" };
	for (int i = 0; i < 3; i++)
	{
		if (a.find(x[i], 0) != string::npos)return false;
	}
	return true;
}
int main()
{
	while (1)
	{
		string a, b;
		if (cin >> b); else break;
		a.append(b);
		while (b.find('.', 0) == string::npos)
		{
			a.append(" ");

			cin >> b;
			a.append(b);
		}
		while (check(a))
		{
			a = henkan(a);
		}
		cout << a << endl;
	}
}