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>
using namespace std;
int main() {
	string a = "";
	while (getline(cin, a)) {
		a += " ";
		string b = "";
		int z = 0, sum = 0;
		int k = a.length();
		for (int i = 0; i <k; i++) {
			if (a[i] == ' ' || a[i] == '.') {
				b = a.substr(z, i - z);
				int t = (int)'t';
				string c = "";
				if (b.length() == 3 || b.length() == 4) {
					c = "";
					int w = t - (int)b[0];
					for (int i = 0; i < b.length(); i++) {
						int d = (char)((int)b[i] + w);
						if (d > 'z')
							d -= 26;
						else if (d < 'a')
							d += 26;
						c += (char)d;
					}
					if (c == "the" || c == "that" || c == "this") {
						sum = w;
						break;
					}
				}
				z = i + 1;
			}
		}
		string f = "";

		for (int i = 0; i < k - 1; i++) {
			if (a[i] != ' ' && a[i] != '.') {
				int g = (int)a[i] + sum;
				if (g >(int)'z')
					g -= 26;
				else if (g < (int)'a')
					g += 26;
				f += (char)g;
			}
			else {
				f += a[i];
			}
		}
		cout << f << endl;
	}
}

C++: #include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define rep(i,n) for(i=0;i<n;++i)
#define each(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); itr++)
#define mp make_pair
#define pb push_back
#define fi first
#define sc second

int main(int argc, char const *argv[]) {
  string a="abcdefghijklmnopqrstuvwxyz";
  a += a;

  string s;

  while(getline(cin,s)){
    //cout << s << endl;

    string t="";
    bool end=false;
    int i;
    for(int w=0; w<=25; ++w){
      //printf("w=%d\n", w);
      t="";
      int p=0;
      rep(i,s.size()){
        if('a'<=s[i] && s[i]<='z'){
          t+=a[s[i]-'a'+w];
        }
        else{
          t+=s[i];
          string tmp=t.substr(p,i-p);
          //cout << tmp << endl;

          if(tmp=="this" || tmp=="the" || tmp =="that") end=true;

          p=i+1;
        }
      }

      if(end) break;
    }

    std::cout << t << std::endl;
  }
  return 0;
}

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

using namespace std;

int main()
{
    string input;
    const int alph_lim = 26;

    while (getline(cin, input, '\n')) {
        for (int i = 0; i < alph_lim; i++) {
            for (int j = 0; j < input.size(); j++) {
                if (islower(input[j])) {
                    input[j]++;
                    if (input[j] > 'z') 
                        input[j] -= alph_lim;
                }
            }

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

    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)
{
	a.erase(0,1);
	cout << a << endl;
	return;
}
int main()
{
	string a,b;
	bool fir=false;
	while (cin >> b)
	{
		a.append(" ");
		a.append(b);
		fir = true;
	}
	while (1)
	{
		if (a.find(" the ", 0) != string::npos||a.find(" the.",0)!=string::npos)
		{
			fin(a); return 0;
		}
		if (a.find(" this ", 0) != string::npos||a.find(" this.", 0) != string::npos)
		{
			fin(a); return 0;
		}
		if (a.find(" that ", 0) != string::npos || a.find(" that.", 0) != string::npos)
		{
			fin(a); return 0;
		}
		for (int i = 0; i < a.size(); i++)
		{
			if (a[i] != ' '&&a[i]!='.')a[i] += 1;
			if (a[i]>'z')a[i] = 'a';
		}
	}
}

C++: #include<iostream>
#include <fstream>
#include <stdio.h>
#include <stdlib.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<queue>
#include<sstream>
#include<algorithm>
#include<map>
#include<complex>
using namespace std;


#define li			long long int
#define rep(i,to)	for(int i=0;i<((int)(to));i++)
#define repp(i,start,to)	for(int i=(int)(start);i<((int)(to));i++)
#define pb			push_back
#define sz(v)		((li)(v).size())
#define bgn(v)		((v).begin())
#define eend(v)		((v).end())
#define allof(v)	(v).begin(), (v).end()
#define dodp(v,n)		memset(v,(li)n,sizeof(v))
#define bit(n)		(1ll<<(li)(n))
#define mp(a,b)		make_pair(a,b)
#define rin	rep(i,n)
#define EPS 1e-10
#define ETOL 1e-8
#define MOD 1000000007
#define p2(a,b)		cout<<a<<"\t"<<b<<endl
#define p3(a,b,c)		cout<<a<<"\t"<<b<<"\t"<<c<<endl


int main(){
	string s;
	
		cin.clear();
	
		
	while(getline(cin,s)>0){
		if(sz(s)==0)break;
		rep(i,26){
			if(s.find("the", 0)!=string::npos || s.find("this", 0)!=string::npos || s.find("that", 0)!=string::npos){
				cout<<s<<endl;
				break;
			}
			rep(i,sz(s)){
				if(s[i]=='z')s[i]='a';
				else if(s[i]!=' ' && s[i]!='.')s[i]++;
			}
		}
		cin.clear();
	}
	
	return 0;
}

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(){
    char in[100];
    string S;
    vector<string> vec;
    
    while(EOF!=scanf("%s",in)){
        
        S = in;
        vec.push_back(S);
    }
    
    for(int k=0;k<26;k++){
        
        bool f = false;
        
        for(int i=0;i<vec.size();i++){
            for(int j=0;j<vec[i].size();j++){
                if(vec[i][j]!='.')vec[i][j]++;
                
                if(vec[i][j] > 'z') vec[i][j]='a';
            }
            
            if(vec[i]=="the" || vec[i]=="that" || vec[i]=="this" || vec[i]=="the." || vec[i]=="that." || vec[i]=="this."){
                
                f = true;
                
            }
        }
        
        if(f) break;
    }
    
    for(int i=0;i<vec.size();i++){
        cout << vec[i];
        if(i == vec.size()-1) cout << endl;
        else cout << " ";
    }
    
    return 0;
}

C++: #include<iostream>
#include<math.h>
using namespace std;
int main(){
    string s;
    while(getline(cin,s)){
        for(int i=0;i<26;i++){
            for(int j=0;j<s.length();j++)
                if(s[j]>='a'&&s[j]<='z')
                    s[j]='a'+(s[j]-'a'+1)%26;
            for(int j=2;j<s.length();j++){
                if(s[j]=='e'&&s[j-1]=='h'&&s[j-2]=='t'){
                    if((j-3<0||s[j-3]<'a'||s[j-3]>'z')&&((j==s.length()-1)||s[j+1]<'a'||s[j+1]>'z'))
                       goto next;
                    
                }
                if(j>2)
                    if((s[j]=='s'&&s[j-1]=='i'&&s[j-2]=='h'&&s[j-3]=='t')||(s[j]=='s'&&s[j-1]=='i'&&s[j-2]=='h'&&s[j-3]=='t'))
                        if((j-4<0||s[j-4]<'a'||s[j-4]>'z')&&((j==s.length()-1)||s[j+1]<'a'||s[j+1]>'z'))
                            goto next;
            }
        }
    next:cout<<s<<endl;
    }
}