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 <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
using namespace std;

typedef long long ll;
typedef pair<int, int> P;

#define all(c) (c).begin(), (c).end()
#define pb push_back
#define mp make_pair
#define EXIST(v,i) (find(all(v), i) != (v).end())
#define ERASE(v,i) (v).erase(remove(all(v), i), (v).end())
#define INDEX(v,i) (find(all(v), i) - (v).begin())
#define rep(i,n) for(int i = 0; i < (int)n; ++i)
#define debug(x) cerr << #x << " = " << (x) << endl;

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

const int INF = 100000000;
const double PI = 3.14159265358979323846;
const double EPS = 1e-10;

int main() {
	for(string line; getline(cin, line);) {
		string change(line);
		for(int i = 0, n = line.length(); i < n; i++) {
			if(line[i] != ' ' && line[i] != '.') {
				change[i] -= 'a';
			}
		}
		for(int p = -26; p <= 26; p++) {
			string s(change);
			for(int i = 0, n = s.length(); i < n; i++) {
				if(line[i] != ' ' && line[i] != '.') {
					s[i] = (s[i] + p) % 26;
				}
			}
			for(int i = 0, n = s.length(); i < n; i++) {
				if(line[i] != ' ' && line[i] != '.') {
					s[i] += 'a';
				}
			}
			if(s.find("the") != -1 || s.find("this") != -1 || s.find("that") != -1) {
				cout << s << endl;
				break;
			}
		}
	}
	return 0;
}

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

typedef pair<string, string> P;

P next_word(string sentence) {
  if (sentence.empty()) return make_pair(string(""), string(""));
  if (sentence[0] == ' ' || sentence[0] == '.') {
    return make_pair("", sentence.substr(1));
  } else {
    P recur = next_word(sentence.substr(1));
    return make_pair(sentence[0] + recur.first, recur.second);
  }
}

bool acceptable(string sentence) {
  P p = next_word(sentence);

  while (! p.first.empty() ) {
    if (p.first == "this" || p.first == "the" || p.first == "that")
      return true;

    p = next_word(p.second);
  }
  return false;
}

char slip(char c) {
  if (c < 'a' || 'z' < c) return c;
  
  string alphabet = "abcdefghijklmnopqrstuvwxyza";
  int index = (int)(c - 'a');
  return alphabet[index + 1];
}

char slip(char c, int n) {
  for (int i = 0; i < n; i++)
    c = slip(c);

  return c;
}

string slip(string code, int n) {
  string val;
  for (int i = 0, len = code.length(); i < len; i++)
    val += slip(code[i], n);

  return val;
}

string decode(string code) {
  for (int i = 1; i < 27; i++) {
    string sentence = slip(code, i);
    if (acceptable(sentence))
      return sentence;
  }

  return "";
}

int main() {
  string code;
  while ( getline(cin, code) )
    cout << decode(code) << endl;
}

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) {
    if(s.find("this") != string::npos || s.find("that") != string::npos
       || s.find("the") != string::npos) return true;
    return false;
}

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

C++: #include<stdio.h>

int main()
{
    char a;
    while(scanf("%c",&a)==1)
    {
if (a =='a')
    printf("w");
if (a=='b')
    printf("x");
if (a=='c')
    printf("y");
if (a=='d')
    printf("z");
if (a=='e')
    printf("a");
if (a=='f')
    printf("b");
if (a=='g')
    printf("c");
if (a=='h')
    printf("d");
if (a=='i')
    printf("e");
if (a=='j')
    printf("f");
if (a=='k')
    printf("g");
if (a=='l')
    printf("h");
if (a=='m')
    printf("i");
if (a=='n')
    printf("j");
if (a=='o')
    printf("k");
if (a=='p')
    printf("l");
if (a=='q')
    printf("m");
if (a=='r')
    printf("n");
if (a=='s')
    printf("o");
if (a=='t')
    printf("p");
if (a=='u')
    printf("q");
if (a=='v')
    printf("r");
if (a=='w')
    printf("s");
if (a=='x')
    printf("t");
if (a=='y')
    printf("u");
if (a=='z')
    printf("v");
if (a==' ')
    printf(" ");
if (a=='\n')
    printf("\n");
if (a=='.')
    printf(".");
if (a==',')
    printf(",");
if (a=='!')
    printf("!");
if (a=='/')
    printf("/");
    if (a=='?')
    printf("?");
    if (a==':')
    printf(":");
    if (a==':')
    printf(":");
    if (a=='@')
    printf("@");
    if (a=='1')
    printf("1");
    if (a=='2')
    printf("2");
    if (a=='3')
    printf("3");
    if (a=='4')
    printf("4");
    if (a=='5')
    printf("5");
    if (a=='6')
    printf("6");
    if (a=='7')
    printf("7");
    if (a=='8')
    printf("8");
    if (a=='9')
    printf("9");
    if (a=='0')
    printf("0");
    if (a=='=')
    printf("=");
    if (a=='+')
    printf("+");
    if (a=='-')
    printf("-");
    if (a=='_')
    printf("_");
    }
    return 0;
}

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

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

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