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 <algorithm>
#include <cstdlib>
#include <vector>
#include <sstream>      // std::ostringstream
std::vector<std::string> split(const std::string &str, char sep)
{
	std::vector<std::string> v;
	std::stringstream ss(str);
	std::string buffer;
	while (std::getline(ss, buffer, sep)) {
		v.push_back(buffer);
	}
	return v;
}
using namespace std;
int main() {
	string str;
	string w[3] = { "the","this",  "that" };
	while (true) {
		getline(cin, str);

		if (str == "")break;

		vector<string> v = split(str, ' ');

		int key;
		bool f = false;

		v[v.size() - 1].pop_back();

		for (int i = 0; i < v.size();i++) {
			for (int j = 1; j < 26;j++) {
				string temp;
				for (int k = 0; k < v[i].size();k++) {
					temp += (v[i][k] - 'a' + j) % 26 + 'a';
				}
				for (int k = 0; k < 3;k++) {
					if (temp == w[k]) {
						f = true;
						key = j;
						break;
					}
				}
				if (f)break;
			}
			if (f)break;
		}

		for (int i = 0; i < v.size();i++) {
			for (int k = 0; k < v[i].size();k++) {
				cout << char((v[i][k] - 'a' + key) % 26 + 'a');
			}
			if (i == v.size() - 1) {
				cout << ".";
			}
			else {
				cout << " ";
			}
		}
		cout << endl;
	}
}

C++: 

#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(i=0;i<n;i++)
#define loop(i,a,n) for(i=a;i<n;i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

typedef vector<int> vi;
typedef pair<int,int> pii;

int main(void) {
  int i,j,k;
  string s;
  char ans[6][10]={"the","the.","this","this.","that","that."};
  while(getline(cin,s)){
    int n=0;
    rep(i,s.size())if(s[i]==' ')n++;
    n++;
    vector<string> word(n);
    i=0;
    rep(j,n){
      while(s[i]!=' '&&s[i]!='\0')
	word[j].push_back(s[i]),i++;
      i++;
    }
    rep(k,26){
      bool c=false;
      rep(i,n)rep(j,word[i].size())
	if(word[i][j]=='z')word[i][j]='a';
	else if(word[i][j]<='z' && word[i][j]>='a')
	  word[i][j]=word[i][j]+1;
      rep(i,n)rep(j,6)
	if(word[i]==ans[j]){
	  c=true;
	}
      if(c){
	rep(i,n){
	  if(i)cout<<" ";
	  cout<<word[i];
	}
	cout<<endl;
	break;
      }
    }
  }
}

C++: #include <cmath>
#include <iostream>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
#include <sstream>

using namespace std;

string decode(string inp,int n){
    string in=inp;
    for(int i=0;i<in.length();i++){
        if('a'<=in[i]&&in[i]<='z'){
            
            in[i]=in[i]-n;
            if(in[i]<'a') in[i]+=('z'-'b');
        }
    }
    return in;
}


int main(){
    string input,decoded;
    while(getline(cin,input)){
        for(int i=0;i<26;i++){
            decoded=decode(input,i);
            if(decoded.find("the")!=string::npos||decoded.find("this")!=string::npos||decoded.find("that")!=string::npos){
                break;
            }
        }
        cout << decoded << endl;
    }
    return 0;
}

C++: #include<iostream>
#include<cstring>
#include<sstream>
using namespace std;
/*
string text = "hello world";
stringstream ss(text);
string t;
while (ss >> t){
*/
void fin(string a)
{
	cout << a << endl;
	return;
}
int main()
{
	string a,b;
	bool fir=false;
	while (cin >> b)
	{
		if(fir)a.append(" ");
		a.append(b);
		fir = true;
	}
	while (1)
	{
		if (a.find("the", 0) != string::npos)
		{
			fin(a); return 0;
		}
		if (a.find("this", 0) != string::npos)
		{
			fin(a); return 0;
		}
		if (a.find("that", 0) != string::npos)
		{
			fin(a); return 0;
		}
		for (int i = 0; i < a.size()-1; i++)
		{
			if (a[i] != ' ')a[i] += 1;
			if (a[i]>'z')a[i] = 'a';
		}
	}
	

}

C++: #include<stdio.h>
#include<string>
#include<stdlib.h>
#include<math.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<numeric>
#include<string.h>
#include<map>
#include<queue>

using namespace std;

typedef pair<int,int> pii;

#define rep(i,j) for(int i=0;i<(j);i++)
#define reps(i,j,k) for(int i=j;i<=k;i++)
#define in(i,j,k) ((i)>=(j)&&(i)<=(k))


int main(){
	char s[81];
	int l;
	while(gets(s)[0]!=0){
		l=strlen(s);
		while(strstr(s,"the")==NULL && strstr(s,"that")==NULL && strstr(s,"this")==NULL){
			rep(i,l){
				if(in(s[i],'a','z')){
					s[i]++;
					if(s[i]>'z')s[i]-=26;
				}
			}
		}
		puts(s);
	}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
signed main(){
        char s[100];
        while( fgets(s, 100, stdin) != NULL ){
                for(int i=0;i<26;i++){
                        for(int j=0;j<100;j++){
                                if(s[j]=='a') s[j] = 'z';
                                else if('a'<s[j]&&s[j]<='z') s[j]-=1;
                        }
                        if(strstr(s,"the")!=NULL ||
                                        strstr(s,"this")!=NULL ||
                                        strstr(s,"that")!=NULL){
                                printf("%s",s);
                                break;
                        }
                }
        }
        return 0;
}