Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func incrementByte(b byte) byte {
	if b >= 97 && b < 122 {
		return b + 1
	} else if b == 122 {
		return 97
	}
	return b
}

func main() {
	scanner.Split(bufio.ScanLines)

	for {
		line := nextString()
		if len(line) == 0 {
			break
		}
		for i := 0; i <= 26; i++ {
			decoded := []byte{}
			for j := 0; j < len(line); j++ {
				decoded = append(decoded, incrementByte(line[j]))
			}
			line = string(decoded)
			if strings.Contains(line, "the") || strings.Contains(line, "this") || strings.Contains(line, "that") {
				fmt.Println(line)
				break
			}
		}
	}
}

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

std::string& test_decode(std::string& decoded_text)
{
	for (char& c : decoded_text) {
		if (c == 'a') {
			c = 'z';
		}
		else if (c != '.' && c != ' ') {
			c -= 1;
		}
	}
	return decoded_text;
}

int main()
{
	std::string encrypted_text;

	while (std::getline(std::cin, encrypted_text)) {
		do {
			test_decode(encrypted_text);
		} while (encrypted_text.find("the")  == std::string::npos &&
				 encrypted_text.find("this") == std::string::npos &&
				 encrypted_text.find("that") == std::string::npos);
		std::cout << encrypted_text << std::endl;
	}

	return 0;
}

C++: #include <stdio.h>

int main(void)
{
	char str[80];
	int num, num2;
	int i;
	
	while (fgets(str, 80, stdin) != NULL){
		num = 't' - str[0];
		printf("%d\n", num);
		i = 0;
		while (str[i] != '\0'){
			if (str[i] != '.' && str[i] != ' ' && str[i] != '\n'){
				str[i] += num;
				if (str[i] > 'z'){
					num2 = str[i] - 'z';
					str[i] = num2 + 'a' - 1;
				}
				else if (str[i] < 'a'){
					num2 = 'a' - str[i] - 204;
					str[i] = 'z' - num2 + 1;
				}
			}
			i++;
		}
		printf("%s", str);
	}
	
	printf("\n");
	
	return (0);
}

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

int main(void){
    char buf[128];
    bool found;
    
    while (gets(buf) != NULL){
        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 <stdio.h>
#include <string.h>

char s1[100];
char s2[100];

int main()
{
	while(1)
	{
		if(NULL == fgets(s1,100,stdin))
		{
			break;
		}
		s1[strlen(s1) - 1] = '\0';
		int l = strlen(s1);
		for(int i = 0; i < 26; i++)
		{
			strcpy(s2,s1);
			for(int j = 0; j < l; j++)
			{
				if('a' <= s2[j] && s2[j] <= 'z')
				{
					s2[j] += i;
					if(s2[j] > 'z')
					{
						s2[j] -= 26;
					}
				}
			}
			if(NULL != strstr(s2,"the") || NULL != strstr(s2,"this") || NULL != strstr(s2,"that"))
			{
				printf("%s\n",s2);
				break;
			}
		}
	}
	return 0;
}

C++: #include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <string>
#include <cmath>
#include <complex>
#include <map>
using namespace std;

#define rep(i,n) for(int i=0;i<int(n);++i)
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define EPS 1e-8
#define F first
#define S second

static const double PI=6*asin(0.5);
typedef long long ll;
typedef complex<double> CP;
typedef pair<long long,int> P;
static const int INF=1<<24;

string s;

int main(){
	while(getline(cin,s)){
		rep(i,s.size()){
			if(s[i]>='a'&&s[i]<='z'){
				s[i]-='a';
			}
			else if(s[i]==13){
				s[i]=200;
			}
		}
		for(int i=0;;i++){
			bool f=false;
			//cout<<s.size()<<endl;
			rep(j,s.size()-3){
				if(s[j]=='t'-'a'&&s[j+1]=='h'-'a'&&((s[j+2]==0&&s[j+3]=='t'-'a')||(s[j+2]=='i'-'a'&&s[j+3]=='s'-'a')||s[j+2]=='e'-'a')){
					f=true;
					break;
				}
			}
			if(s[s.size()-3]=='t'-'a'&&s[s.size()-2]=='h'-'a'&&s[s.size()-1]=='e'-'a') f=true;
			if(f) break;
			else{
				rep(j,s.size()){
					if(s[j]<='z'-'a'&&s[j]>=0){
						s[j]=(s[j]+1)%('z'-'a'+1);
					}
				}
			}
		}
		rep(i,s.size()){
			if(s[i]<='z'-'a'&&s[i]>=0){
				s[i]+='a';
			}
			else if(s[i]==200){
				s[i]=13;
			}
		}
		cout<<s<<endl;
			
	}
	return 0;
}

C++: // includes
#include <cstdio>
#include <cstdint>
#include <iostream>
#include <iomanip>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <utility>
#include <functional>
#include <cmath>
#include <climits>
#include <bitset>

// macros
#define ll long long int
#define pb push_back
#define mk make_pair
#define pq priority_queue
#define FOR(i, a, b) for(int i=(a); i<(b);++i)
#define rep(i, n) FOR(i, 0, n)

using namespace std;

//  types
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
typedef pair<ll, ll> Pll;
 
// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double EPS = 1e-10;

// solve

int main(int argc, char const* argv[])
{
  string s;
  while(getline(cin, s)){
    FOR(i, 1, 26){
      string t = s;
      string res = "";
      rep(j, t.size()){
        if(!('a' <= s[j] && s[j] <= 'z')){
          res += t[j];
        }else{
          res += char(((int(t[j] - 'a') + i) % 26) + 'a');
        }
      }
      string tmp = "";
      bool flag = false;
      rep(j, res.size()){
        if(res[j] != ' ')tmp += res[j];
        else{
          if(tmp == "the" || tmp == "this" || tmp == "that"){
            flag = true;
            break;
          }
          tmp = "";
        }
      }
      if(flag){
        cout << res << endl;
        break;
      }
    }
  }
	return 0;
}

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

bool checkString(int* key, string s);
void rotateChar(string* s, int i);

int main()
{
    list<string> table;
    char text[80];
	int size=0;

	for(size=0; cin.get(text[size]); size++ ){;}

	char ch;
	string s;
	for(int i=0; (ch=text[i])!=EOF; i++){
		if(ch!=' ')s.push_back(ch);
		else{ table.push_back(s), s.clear();}
	}		

    int key; // ずらす文字数
    list<string>::iterator i;
    for(i=table.begin(); i!=table.end(); i++){
        // cout << *i << " ";
        if( i->size() == 3 || i->size() == 4 )
            if( checkString(&key, *i) ) break;
    }
	
	for(int i=0; i<size; i++){
		char ch = text[i];
		if(isalpha(ch)){
        char c = ch - 'a';
        ch = 'a' + (c+key)%26;
		}
		cout.put(ch);
	}

    return 0;
}

void rotateChar(string* s, int i) // iは何文字ずらしたいか
{

    for(int j=0; j<s->size(); j++){
        if(!isalpha(s->at(j))){continue;}
        char c = s->at(j) - 'a';
        s->at(j) = 'a' + (c+i)%26;
    }
}

bool checkString(int* key, string s)
{

    for(int i=0; i<26; i++){
        string tmp = s;
        rotateChar(&tmp, i);
        // cout << tmp << endl;
        if( tmp=="the" || tmp=="this" || tmp=="that" ){
            *key=i;
            return true;
        }
    }
    return false;
}