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<cstring>
#include<algorithm>
#include<queue>
#include<cstdio>
#include<string>
using namespace std;
int main()
{
//    freopen("test.txt", "r", stdin);
 //   freopen("testout.txt", "w", stdout);
    string temp, ans;
    string guanjian[3] = { "this","the","that" };
    while (getline(cin, temp))
    {
        ans = temp;
        for (int i = 0; i <= 'z' - 'a'; i++)
        {
            //表示位移量。
            for (int j = 0; j<temp.size(); j++)
            {
                if (temp[j] >= 'a'&&temp[j] <= 'z')
                    ans[j] = (temp[j] - 'a' + i) % ('z' - 'a') + 'a';
                else ans[j]=temp[j];
            }
            if (ans.find(guanjian[0])!= string::npos ||
                    ans.find(guanjian[1]) != string::npos ||
                    ans.find(guanjian[2]) != string::npos)
            {
                cout << ans << endl;
                break;
            }
        }
    }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define NCLR(a) memset((a), -1 ,sizeof(a))
#define dump(x) cout << #x << " = " << (x) << "\n";
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n";
#define sq(n) (n) * (n)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
typedef complex<double> P;
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 1000000007;
static const int INF = 1 << 30;
static const LL LL_INF = 1152921504606846976;
static const int dx[] = { -1, 0, 1, 0, 1, -1, 1, -1 };
static const int dy[] = { 0, -1, 0, 1, 1, 1, -1, -1 };

string str;

int main() {
	string str_copy;
	getline( cin, str );
	for ( int i = 1;; i++ ) {
		str_copy = str;
		for ( int j = 0; j < str_copy.size(); j++ ) {
			if ( str_copy[ j ] >= 'a' && str_copy[ j ] <= 'z' ) {
				str_copy[ j ] += i;
				str_copy[ j ] = ( ( str_copy[ j ] - 'a' ) % 26 ) + 'a';
			}
		}
		bool is_can = false;
		for ( int j = 0; j < str_copy.size() - 2; j++ ) {
			if ( str_copy.substr( j, 3 ) == "the" ) {
				is_can = true;
				break;
			}
		}
		for ( int j = 0; j < str_copy.size() - 3; j++ ) {
			if ( str_copy.substr( j, 4 ) == "that" || str_copy.substr( j, 4 ) == "this" ) {
				is_can = true;
				break;
			}
		}
		if ( is_can ) {
			break;
		}

	}
	printf( "%s\n", str_copy.c_str() );
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include<string>
#include<vector>
int main() {
	std::string s,a;
	std::getline (std::cin , s);
	int p = s[0] - 't';
	for (int i = 0; i < s.size(); ++i) {
		if (s[i] != ' ' &&s[i]!= '.') {
			if (s[i] - p < 'a') {
				a += 'z' - ('a' - (s[i] - p)-1);
			}
			else a += s[i] - p;
		}
		else a += s[i];
	}
	std::cout << a<< std::endl;
	return 0;
}

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

bool isSmallAlphabet(char& ch) {
  /* a ~ z(ascii) : 97 ~ 122 */
  if('a' <= ch && ch <= 'z') return true;
  else return false;
}

bool isHit(string& str) {
  if(str.find("the") != str.npos) return true;
  else if(str.find("this") != str.npos) return true;
  else if(str.find("that") != str.npos) return true;
  else return false;
}

/* ????????¶??????????§£??? */
void CaesarCipher(string _str) {
  
  /* parameter??????????????¢??????????????????????????????????????? */
  for(int parameter = 0; parameter < 26; ++parameter) {
    string str = _str;
    for(int i = 0; i < (int)str.length(); ++i) {
      
      /* ?°?????????¢??????????????????????????? */
      if(isSmallAlphabet(str[i])) {
        str[i] += parameter;
        /* ???????????????????°?????????§???????????£??????*/
        if(!isSmallAlphabet(str[i])) {
          str[i] -= 26;
        }
      }

    }

    /* Find "the" or "this" or "that" */
    if(isHit(str)) {
      cout << str << endl;
    }
  }
}

int main() {
  string str;
  while(getline(cin, str)) {
    CaesarCipher(str);
  }
  return 0;
}

C++: #include <iostream>

using namespace std;

int main() {
    string s;

    while (getline(cin, s)) {
        for (int i = 0; i < 26; i++) {
            for (int j = 0; j < s.size(); j++) {
                if (s[j] >= 'a' && s[j] <= 'z') {
                    s[j] = (s[j] - 'a' + 1) % 26 + 'a';
                }
            }

            //cout << s << endl;

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

    return 0;
}

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

int main(void){
	char data[100];
	char s1[]="the",
		 s2[]="this",
		 s3[]="that";
	int i,cnt=0;
	char *p;

	while((fgets(data,100,stdin))){
		while(cnt<26){
			p=strstr(data,s1);
			if(p)
				break;
			p=strstr(data,s2);
			if(p)
				break;
			p=strstr(data,s3);
			if(p)
				break;
			for(i=0;i<100;i++){
				if(data[i]=='\0')
					break;
				if('a'<=data[i] && data[i]<='y')
					data[i]++;
				else if('z'==data[i])
					data[i]='a';
			}
			printf("cnt=%d\t%s",cnt,data);
			cnt++;
		}
		cnt=0;
		printf("%s",data);
	}
	return 0;
}

C++: #define scanf_s scanf
#define gets_s gets
#include <stdio.h>
#include <string>
#include <iostream>
#include <math.h>
using namespace std;
#define MAX 81
#define _MAX 100
#define ABC 26
int main(void)
{
	int n, s = 0, x, y, r = 0, d;
	char str[MAX];
	while (gets_s(str) != NULL) {
		for (int i = 0; str[i] != '\0'; ++i) {
			if (str[i] - 't' == str[i + 1] - 'h') {
				d = str[i] - 't';
				if ((str[i + 2] - 'a' - d + ABC) % ABC == 'e' - 'a') { break; }
				else if ((str[i + 2] - 'a' - d + ABC) % ABC == 'i' - 'a' && (str[i + 3] - 'a' - d + ABC) % ABC == 's' - 'a') { break; }
				else if ((str[i + 2] - 'a' - d + ABC) % ABC == 'a' - 'a' && (str[i + 3] - 'a' - d + ABC) % ABC == 't' - 'a') { break; }
			}
		}
		for (int i = 0; str[i] != '\0'; ++i) {
			if ('a' <= str[i] && str[i] <= 'z') {
				str[i] = (str[i] - 'a' - d + ABC) % ABC + 'a';
			}
		}
		printf("%s\n", str);
	}
}