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<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()
{
	
	string a, b;
	cin >> b;
	a.append(b);
	while (cin>>b)
	{
		a.append(" ");
		a.append(b);
	}
	while (check(a))
	{
		a = henkan(a);
	}
	cout << a << endl;
	
}

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

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

C++: #include <iostream>
#include <string>

using namespace std;

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

int main()
{
	solve();
	return(0);
}

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

int main(){
    string before;
    while (getline(cin, before)) {
        int swich = 0;
        for (int i = 0;i < 26 ;i++) {
            for (int j = 0; j < before.size(); j++) {
                if (before[j]>'z') {
                    before[j] = 'a';
                }
                else if (isalpha(before[j])) {
                    before[j]++;
                }
            }
            for (int j = 0; j < before.size(); j++) {
                if (before[j]=='t'&& before[j+1]=='h'&& before[j+2]=='e') {
                    if (before[j+3]==' '||before[j+3]=='.') {
                        swich = 1;
                        break;
                    }
                }
                else if (before[j]=='t'&&before[j+1]=='h'&&before[j+2]=='a'&&before[j+3]=='t') {
                    if (before[j+4]==' '||before[j+4]=='.') {
                        swich = 1;
                        break;
                    }
                }
                else if (before[j]=='t'&&before[j+1]=='h'&&before[j+2]=='i'&&before[j+3]=='s') {
                    if (before[j+4]==' '||before[j+4]=='.') {
                        swich = 1;
                        break;
                    }
                }
            }
            if (swich == 1) {
                break;
            }
        }
        cout << before << endl;
    }
    return 0;
}

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

using namespace std;
int main(void)
{
	while(1)
	{
		char a[10000] = {0};
		if(gets(a) == NULL) break;
		int as = strlen(a);
		for(int i = 0;i < 26;i++)
		{
			if(strstr(a,"this") || strstr(a,"that") || strstr(a,"the")) break;
			for(int j = 0;j < as;j++)
			{
				if(isalpha(a[j]) != 0)
				{
					if(a[j] < 'z')
					{
						a[j]++;
					}
					else
					{
						a[j] = 'a';
					}
				}
			}
		}
		printf("%s\n",a);
	}
	return 0;
}

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

int attack(string line)
{
    static const string cmp[3] = {"the", "this", "that"};
    istringstream iss(line);

    for (string word; iss >> word;) {
        char first = word[0];
        for (string c: cmp)
            if (c.size() == word.size()) {
                int i = 1;
                for (; i < c.size(); i++)
                    if ((c[i] - 't') % 26 != (word[i] - first) % 26)
                        break;
                if (i == c.size())
                    return ('t' - first) % 26;
            }
    }

    return -1;
}

inline int rotN(int x, int n)
{
    if (isalpha(x))
        return (x - 'a' + n) % 26 + 'a';
    else
        return x;
}

int main()
{
    int rot;
    string line;

    getline(cin, line);

    rot = attack(line);

    for (auto x : line)
        cout << (char) rotN(x, rot);

    cout << endl;

    return 0;
}

C++: #include <algorithm>
#include <iostream>
#include <cstdio>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <string.h>
using namespace std;

#define ISEQ(c) (c).begin(), (c).end()
typedef long long ll;

int main() {
  char s[90];
  while (fgets(s, 81, stdin) != 0) {
    for (int i = 0; i < 26; i++) {
      for (int j = 0; j < strlen(s); j++) {
	if (isalpha(s[j])) {
	  if (s[j] == 'z') s[j] = 'a';
	  else s[j]++;
	}
      }
      if (strstr(s, "the") != NULL or strstr(s, "this") != NULL or strstr(s, "that") != NULL) break;
    }
    cout << s << endl;
  }
}

C++: #include <cctype>
#include <cstdio>
#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() {
  while (!feof(stdin)) {
    char cipher[81];
    fgets(cipher, 81, stdin);

    size_t len = strlen(cipher);
    if (cipher[len - 1] == '\n') { cipher[len - 1] = '\0'; }

    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);
      puts(decoded);
      for (int i = 0; i < len; ++i) {
        if (isalpha(decoded[i])) { decoded[i] += shift; }
      }
      if (includes_keyword(decoded)) {
        puts(decoded);
        goto FINISH;
      }
    }
  }

FINISH:
  return 0;
}