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

using namespace std;

int main()
{
    char line[100];
    int dist,a,b,h,e,i,s,t,aa;
    while(gets(line)){
        int l=strlen(line);
        //printf("length %d\n",l);
        char *token;
        token=strtok(line," ");
        while(token!=NULL) {//cout<<token<<" ";
            int tl=strlen(token);
            //printf("tl %d\n",tl);
            if(tl==3 || tl==4){
                if(tl==3){
                    a=abs(token[0]-'t');

                    h=token[1]-'a'-a;
                    h+=26;
                    h=h%26;

                    e=token[2]-'a'-a;
                    e+=26;
                    e=e%26;
                    if(h+'a'=='h' && e+'a'=='e'){

                        dist = a;
                        break;
                    }
                }
                if(tl==4){
                    a=abs(token[0]-'t');
                    //printf("a %d\n",a);

                    h=token[1]-'a'-a;
                    h+=26;
                    h=h%26;

                    i=token[2]-'a'-a;
                    i+=26;
                    i=i%26;

                    aa=token[2]-'a' -a;
                    aa+=26;
                    aa=aa%26;

                    s=token[3]-'a'-a;
                    s+=26;
                    s=s%26;

                    t=token[3]-'a' - a;
                    a += 26;
                    a = a%26;

                    if(h+'a'=='h' && (i+'a'=='i' ||aa+'a'=='a') && (s+'a'=='s' || t+'a'=='t')){

                        dist = a;
                        break;
                    }
                }
            }
            token=strtok(NULL," ");
            }

        //printf("length %d\n",dist);
            for(int i=0;i<l;i++){
            if(line[i]>='a' && line[i]<='z'){
                a=line[i]-'a';
                a=(a-dist);
                a+=26;
                a=a%26;
                line[i]='a'+a;
                printf("%c",a+'a');
            }
            else
                printf("%c",line[i]);
        }
        printf("\n");
    }

    return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
int main() {string here,ans;while (getline(cin,here)) for (int i=0;i<26;i++) {ans=here;for (int j=0;j<ans.size();j++) if (ans[j]>='a' && ans[j]<='z') ans[j]=(ans[j]-'a'+i)%26+'a';if (ans.find("that",0) != string::npos || ans.find("this",0) != string::npos || ans.find("the",0) != string::npos) {cout<<ans<<endl;break;}} return 0;}

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

using namespace std;

int main() {
    string a;
    
    getline(cin,a);
    
    while (1){
        if(a.find("this")!=-1 || a.find("the")!=-1 || a.find("that")!=-1){
            break;
        }
        
        for(int i=0; i<a.length(); i++){
            if(a[i]==' '|| a[i]=='.'){
                
            }else if(a[i]=='z'){
                a[i]='a';
            }else{
                a[i]++;
            }
        }

    }
    cout<<a<<endl;;
    
    
    return 0;
}

C++: #include<iostream>
#include<vector>
#include<string>
#include<sstream>
int main()
{
	std::vector<std::string>result;
	for (std::string s; std::getline(std::cin, s);)
	{
		int delta = 0;
		std::stringstream ss;
		ss << s;
		while (!ss.eof())
		{
			std::string temp;
			ss >> temp;
			if (temp.length() == 3 && temp[0] != '.' && temp[1] != '.' && temp[2] != '.')
			{
				int d1 = temp[0] - 't';
				int d2 = temp[1] - 'h';
				int d3 = temp[2] - 'e';
				for (auto i : { &d1,&d2,&d3 })
				{
					if (*i < 0)
					{
						*i += 26;
					}
				}
				if (d1 == d2 && d2 == d3)
				{
					delta = d1;
					break;
				}
			}
			else if (temp.length() == 4 && temp[0] != '.' && temp[1] != '.' && temp[2] != '.' && temp[3] != '.')
			{
				int d1 = temp[0] - 't';
				int d2 = temp[1] - 'h';
				int d3 = temp[2] - 'i';
				int d4 = temp[3] - 's';
				for (auto i : { &d1,&d2,&d3,&d4 })
				{
					if (*i < 0)
					{
						*i += 26;
					}
				}
				if (d1 == d2 && d2 == d3 && d3 == d4)
				{
					delta = d1;
					break;
				}
				d1 = temp[0] - 't';
				d2 = temp[1] - 'h';
				d3 = temp[2] - 'a';
				d4 = temp[3] - 't';
				for (auto i : { &d1,&d2,&d3,&d4 })
				{
					if (*i < 0)
					{
						*i += 26;
					}
				}
				if (d1 == d2 && d2 == d3 && d3 == d4)
				{
					delta = d1;
					break;
				}
			}
		}
		if (delta > 0)
		{
			delta -= 26;
		}
		result.push_back(std::string(s.length(), 'a'));
		for (int i = 0; i < s.length(); i++)
		{
			result.back()[i] = 'a' <= s[i] && s[i] <= 'z' ? (s[i] - 'a' - delta) % 26 + 'a' : s[i];
		}
	}
	for (auto i : result)
	{
		std::cout << i << std::endl;
	}
	return 0;
}

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

int main(void){
  while(true){
    string str;
    if(!getline(cin, str)) break;;
    while(true){
      for(int i = 0; i < str.size(); i++){
        if(isalpha(str[i]) && str[i] == 'z'){
          str[i] = 'a';
        }else if(isalpha(str[i])){
          str[i]++;
        }
      }
      if(str.find("that") != string::npos || str.find("this") != string::npos || str.find("the") != string::npos) break;
    }
    cout << str << endl;
  }
  return 0;
}

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

int main(){
	int i;
	string str;
	getline(cin, str);
	string strcp = str;
	string::iterator si;
	for(i=0;i<num;i++){
		if(  strcp.find("this") != string::npos
		  || strcp.find("that") != string::npos
		  || strcp.find("the" ) != string::npos){
			cout << strcp << endl;
		}
		si = strcp.begin();
		while(si != strcp.end()){
			if('a' <= *si && *si <= 'y'){
				*si = *si + char(1);
			}else if(*si == 'z'){
				*si = 'a';
			}
			si++;
		}
	}
	return 0;
}