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 <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>

using namespace std;
typedef long long ll;

int main(){
    int in;
    char S[100];
    vector<string> vec;
    
    for(int i=0;;i++){
        
        in = getchar();
        
        if(in<0){
            S[i]='\0';
            break;
        }else{
            S[i]=(char)in;
        }
    }
    
    for(int k=0;k<26;k++){
        
        bool f = false;
        
        for(int i=0;S[i]!='\0';i++){
            if('a'<=S[i] && S[i]<='y'){
                S[i]++;
            }else if(S[i]=='z'){
                S[i]='a';
            }
            
            if(i>=2){
                if(S[i-2]=='t' && S[i-1]=='h' && S[i]=='e')
                    f=true;
            }
            if(i>=3){
                if(S[i-3]=='t' && S[i-2]=='h')
                    if((S[i-1]=='i' && S[i]=='s') || (S[i-1]=='h' && S[i]=='t'))
                    f=true;
            }
        }
        
        if(f) break;
    }
    
    for(int i=0;S[i]!='\0';i++)
        printf("%c",S[i]);
    
    return 0;
}

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

string decy(string s,int k) {
    string res = "";
    for(int i=0; i<s.length(); ++i) {
        if(s[i] >= 'a' && s[i] <= 'z') res += string(1,(s[i]-'a'+k)%26+'a');
        else res += string(1, s[i]);
    }
    return res;
}

bool isvalid(string s) {
    for(int i=0; i<=s.length()-4; ++i) {
        string ss = s.substr(i,4);
        if(ss == "this" || ss == "that") return true;
    }
    for(int i=0; i<=s.length()-3; ++i) {
        string ss = s.substr(i,3);
        if(ss == "the") return true;
    }
}

int main() {
    string s;
    while(getline(cin,s)) {
        for(int i=0; i<=25; ++i) {
            s = decy(s,1);
            //cout<<s<<endl;
            if(isvalid(s)) {
                cout<<s<<endl;
                break;
            }
        }
    }
}

C++: #include <bits/stdc++.h>

using namespace std;

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

C++: #include <cctype>
#include <cstdio>
#include <cstdlib>
#include <cstring>

using namespace std;

bool includes_keyword(const char *str) {
  const static char *keywords[] = { "the", "this", "that" };
  for (const auto keyword : keywords) {
    const char *pos = strstr(str, keyword);
    if (pos == NULL) { continue; }
    if (pos != str && isalpha(pos[-1])) { continue; }
    if (isalpha(pos[strlen(keyword)])) { continue; }
    return true;
  }
  return false;
}

int main() {
  char *cipher = NULL;
  size_t buffer_size = 0;
  ssize_t len;
  while ((len = getline(&cipher, &buffer_size, stdin)) > 0) {
    if (cipher[len - 1] == '\n') {
      cipher[len - 1] = '\0';
      len -= 1;
    }

    char c = 'z';
    for (int i = 0; i < len; ++i) {
      if (isalpha(cipher[i]) && c > cipher[i]) { c = cipher[i]; }
    }
    int shift_begin = 'a' - c;
    int shift_end = shift_begin + 26;
    char decoded[81];
    for (int shift = shift_begin; shift < shift_end; ++shift) {
      strcpy(decoded, cipher);
      for (int i = 0; i < len; ++i) {
        if (isalpha(decoded[i])) { decoded[i] += shift; }
      }
      if (includes_keyword(decoded)) {
        puts(decoded);
        break;
      }
    }
  }

  free(cipher);

  return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <stdlib.h>
using namespace std;

int main(void){
	vector<string> v;
	string str;

	while(cin>>str){
		v.push_back(str);
	}

	for(int cif=0;cif!=26;cif++){
		for(int i=0;i<v.size();i++){
			for(int j=0;j<v[i].length();j++){
				if('A'<=v[i][j]&&v[i][j]<='Z'){
					v[i][j]=(v[i][j]-'A'+cif)%26+'A';
				}else if('a'<=v[i][j]&&v[i][j]<='z'){
					v[i][j]=(v[i][j]-'a'+cif)%26+'a';
				}
			}
		}
		for(int i=0;i<v.size();i++){
			if(v[i]=="that" || v[i]=="the"||v[i]=="this"){
				for(int k=0;k<v.size();k++){
					if(k!=v.size()-1)cout<<v[k]<<" ";
					else cout<<v[k];
				}
				exit(0);
			}
		}
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){ 
  char a;
  while(cin>>a){
    if(a==' '||a=='.'||a=='\n')cout<<a;
     else 
       for(int i=0;i<26;i++){
	 if((char)(a+i)=="that"||(char)(a+i)=="this"||(char)(a+i)=="the") {
	  cout<<(char)(a+i);
	  break;
	  }
	i++;
	}
    cout<<endl;
  }
    return 0;
  }

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



char slide(char ch, int dif) {
  if( ! isalpha(ch) ) return ch;

  int n = ch - 'a';
  n = (n + dif ) % 26;
  return 'a' + n;
}

int main() {
  string line; getline(cin, line);
  
  for(int dif = 0; dif < 26; dif++) {
    string str = line;
    
    for(int i = 0; i < (int)str.size(); i++) 
      str[i] = slide( str[i], dif);

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

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