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 <string>
#include <vector>
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <map>
#define INF 100000000
#define rep(i,a) for(int i=0;i<(a);i++)

using namespace std;
typedef long long ll;

char p(char ch){
    char ret=ch+1;
    if(ret==('{'))ret='a';
    return ret;
}


int main(){
    string s;
    getline(cin,s);


    rep(i,30){
        rep(i,s.size()){
            if(s[i]!=' ' && s[i]!='.'){
                s[i]=p(s[i]);
            }
        }

        if( s.find("the",0)!=-1 || s.find("this",0)!=-1 || s.find("that",0)!=-1 ){
            break;
        }
    }
    cout<<s<<endl;
    
    return 0;
    
}

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

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

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

char ab(char c){
	if(c == 'z'){
		return 'a';
	}
	if(c == ' ' || c == '.' || c == '\n'){
		return c;
	}
	return c + 1;
}

char ba(char c){
	if(c == 'a'){
		return 'z';
	}
	if(c == ' '|| c == '.' || c == '\n'){
		return c;
	}
	return c - 1;
}

int main(){
	char s[82];
	char *f;
	char c;
	int sh, a;

	while(scanf("%c", &s[0]) + 1){
		char th[3][5] = {"the", "this", "that"};

		a = 0;
		while(s[a] - 10){
			a++;
			scanf("%c", &s[a]);
		}
	
		a++;
		s[a] = '\0';
		f = 0;
		for(int i = 0; i < 26; i++){
			f = 0;
			for(int j = 0; j < 3; j++){
				f = strstr(s, th[j]);
				if(f){
					j += 3;
					sh = i;
					i += 26;
				}
			}

			for(int j = 0; j < 3; j++){
				int t = 0;
				while(th[j][t]){
					th[j][t] = ab(th[j][t]);
					t++;
				}
			}
		}

		a = 0;
		while(s[a]){
			char shc = s[a];
			for(int i = 0; i < sh; i++){
				shc = ba(shc);
			}
			printf("%c", shc);
			a++;
		}
	}
}

C++: #define _USE_MATH_DEFINES

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <utility>
#include <vector>
#include <numeric>

using namespace std;

int caesar(string s)
{
	string s0 = "this";
	string s1 = "that";
	string s2 = "the";

	if (s.size() > 5)
	{
		return -1;
	}

	for (int i = 0; i <= 26; i++)
	{
		if (s.substr(0, 4) == s0 || s.substr(0, 4) == s1 || s.substr(0, 3) == s2)
		{
			return i;
		}
		for (int j = 0; j < 4; j++)
		{
			s0.at(j) = s0.at(j)++;
			if (s0.at(j) > 'z')
			{
				s0.at(j) = 'a';
			}
			s1.at(j) = s1.at(j)++;
			if (s1.at(j) > 'z')
			{
				s1.at(j) = 'a';
			}
		}
		for (int j = 0; j < 3; j++)
		{
			s2.at(j) = s2.at(j)++;
			if (s2.at(j) > 'z')
			{
				s2.at(j) = 'a';
			}
		}
	}

	return -1;
}

int main()
{
	string str;
	for (; getline(cin, str);)
	{
		stringstream ss;
		ss << str;

		vector<string> w;
		string s;
		int c = -1;
		for (; ss >> s;)
		{
			w.push_back(s);
			
			if (c == -1)
			{
				c = caesar(s);
			}
		}

		for (int i = 0; i < w.size(); i++)
		{
			for (int j = 0; j < w.at(i).size(); j++)
			{
				if (w.at(i).at(j) != '.')
				{
					char sp = w.at(i).at(j) - c;
					if (sp < 'a')
					{
						int p = 'a' - sp;
						w.at(i).at(j) = 'z' - p;
					}
					else
					{
						w.at(i).at(j) = sp;
					}
				}			
			}

			cout << w.at(i) << (i == w.size() - 1 ? "" : " ");
		}

		cout << endl;
	}
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <cstring>
#include <functional>

using namespace std;

#define REP(i,a,b) for((i)=(a);(i)<(int)(b);(i)++)
#define rep(i,n) REP(i,0,n)
// BEGIN CUT HERE
#define foreach(itr,c) for(typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
template<class T> inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}
// END CUT HERE

int main(){
  string str;

  while(getline(cin,str)){
    int i, N = str.size();

    while(1){
      rep(i,N) if('a' <= str[i] && str[i] <= 'z'){
        str[i]--;
        if(str[i] < 'a') str[i] = 'z';
      }
      if(str.find("this") != -1 || str.find("the") != -1 || str.find("that") != -1){
        cout << str << endl;
        break;
      }
    }
  }

  return 0;
}

C++: #include <bits/stdc++.h>
#include <vector>
using namespace std;
string str;	
int a, b, c, d;
int main(){
	getline(cin, str);
	a = str.length();
	for(int i = 0; i < a; i++){
		if(str[i] < 97 || str[i] > 122){
			cout << str[i];
		}
		else {
			b = (int)str[i];
			b = b - 4;
			if(b < 97)
				b = b + 26;
			cout << (char)b;
		}
	}
	cout << endl;
	return 0;
}

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

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

C++: #include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++) 
#define ALL(n) begin(n),end(n)
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
int main()
{
    string S;
    while( getline( cin, S ) )
    {
        while( S.find( "the" ) == string::npos || S.find( "this" ) == string::npos || S.find( "that" ) == string::npos )
        {
            REP( i, (int)S.size() )
            {
                if( S[ i ] != ' ' && S[ i ] != '.' )
                {
                    if( S[ i ] == 'z' )
                    {
                        S[ i ] = 'a';
                        continue;
                    }
                    S[ i ]++;
                }
            }
        }
        cout << S << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <sstream>

using namespace std;

bool is_comprehensible(const string& str){
	istringstream iss(str);
	string word;
	while(iss >> word){
		if(word == "the" || word == "this" || word == "that"){
			return true;
		}
	}
	return false;
}

string shift_string(const string& str, char n){
	string result;
	for(auto& v: str){
		if('a' <= v && v <= 'z'){
			result += (v - 'a' + n) % 26 + 'a';
		}
		else{
			result += v;
		}
	}
	return result;
}

int main(){
	string str;
	cin >> noskipws;
	char c;
	while(cin >> c){
		str += c;
	}
	
	for(int i = 0; i < 26; ++i){
		auto shifted = shift_string(str, i);
		if(is_comprehensible(shifted)){
			cout << shifted << flush;
			break;
		}
	}
	return 0;
}