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 <stdio.h>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <stdlib.h>
#include <vector>

using namespace std;


int main(){

	vector<string> str, ans;
	string temp;
	int slide;

	while(cin >> temp){
		str.push_back(temp);
	}

	for(int i=0 ; i<str.size() ; i++){
		ans.push_back(str[i]);
	}

	for(int i=0 ; i<25 ; i++){

		for(int j=0 ; j<str.size()-1 ; j++){
			for(int k=0 ; k<str[j].size() ; k++){
				str[j][k]++;
				if(str[j][k] > 'z'){
					str[j][k] = str[j][k] - 'z' + 'a' -1;
				}
			}
		}

		for(int k=0 ; k<str[str.size()-1].size()-1 ; k++){
			str[str.size()-1][k]++;
			if(str[str.size()-1][k] > 'z'){
				str[str.size()-1][k] = str[str.size()-1][k] - 'z' + 'a' -1;
			}
		}
		for(int k=0 ; k<str.size() ; k++){
			if(str[k] == "the" || str[k] == "that" || str[k] == "this"){
				slide = i+1;
				break;
			}
		}
	}

	for(int i=0 ; i<ans.size()-1 ; i++){
		for(int k=0 ; k<ans[i].size() ; k++){
			if((ans[i][k] + slide) > 'z'){
				ans[i][k] = ans[i][k] - 'z' + 'a' -1 + slide;
			}
		}
		cout << ans[i] << ' ';
	}

	for(int i=0 ; i<ans[ans.size()-1].size() ; i++){
		if((ans[ans.size()-1][i] + slide) > 'z'){
			ans[ans.size()-1][i] = ans[ans.size()-1][i] - 'z' + 'a' -1 +slide;
		}
	}
	cout << ans[ans.size()-1] << endl;

	return 0;
}

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

int kanji(int in, int z){
	if (in > 96) {
		return in - z;
	}
	else{
		return in;
	}
}

int main(){
	while (true)
	{
		string input, output;
		int z = 0, k;
		getline(cin, input);
		if (cin.eof()) { break; }
		int innum[81] = {};
		for (int i = 0;i<input.size();i++){
			innum[i] = input[i];
		}

		for(int i=0;i<input.size();i++){
			if(innum[i]-innum[i+1] == 12){
				if(innum[i]-innum[i+2] == 15){
					k = innum[i] - 116;
					break;
				}
				else if(innum[i]-innum[i+2] == 11){
					if(innum[i]-innum[i+3] == 1){
						k = innum[i] - 116;
						break;
					}
				}
				else if(innum[i]-innum[i+2] == 19){
					if(innum[i]-innum[i+3] == 0){
						k = innum[i] - 116;
						break;
					}
				}
			}
		}

		for(int i=0;i<input.size();i++){
			output += kanji(innum[i], k);
		}
		cout << output << endl;
	}
}

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

int find_cnt;
string find_str;

bool find(string str, string can) {
  string tmp_can = ' ' + can + ' ';
  string tmp_str = ' ' + str + ' ';
  int cnt = 0;
  for (int i = 0; i < tmp_str.length(); ++i) {
    if (string::npos != tmp_str.find(tmp_can, i)) {
      cnt++;
    }
  }
  if (find_cnt < cnt) {
    find_cnt = cnt;
    find_str = str;
  }
  return false;
}

int main() {
  string str;
  string candies[] = {"this", "the", "that"};
  while(getline(cin, str)) {
    find_cnt = 0;
    find_str = "";
  for (int m = 1; m < 26; ++m) {
    for (int i = 0; i < str.length(); ++i) {
      if (str[i] == ' ') {
        continue;
      }
      if (str[i] == ',' || str[i] == '.') {
        str[i] = ' ';
        continue;
      }
      int char_id = static_cast<int>(str[i]) - 97;
      int shifted = static_cast<int>(char_id + 1);
      str[i] = static_cast<char>(shifted % 26 + 97);
    }
    for (int i = 0; i < sizeof(candies) / sizeof(candies[0]); ++i) {
      find(str, candies[i]);
    }
  }
  if (find_str != "") { 
    cout << find_str << endl;
  }
  }
  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;
	set<string> s;
	getline( cin, str );
	for ( int i = 1;; i++ ) {
		str_copy = str;
		bool can_continue = false;
		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';
				if ( str_copy[ j ] < 'a' || str_copy[ j ] > 'z' ) {
					can_continue = true;
					break;
				}
			}
		}
		if ( s.count( str_copy ) ) {
			continue;
		}
		s.insert( str_copy );
		if ( can_continue ) {
			continue;
		}
		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 <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <string>
#include <algorithm>
#include <string>
#include <climits>
#include <iomanip>
#include <utility>

#define REP(i, n) for (int (i) = 0; (i) < (int)(n); (i)++)
#define REG(i, a, b) for (int (i) = ((int)(a)); (i) < ((int)(b)); i++)
#define ALL(V) (V).begin(), (V).end()
#define PRINT(STR) cout << (STR) << endl
#define DEBUG(X) cerr << X << " (" << __LINE__ << ", " << __func__ << " )" << endl;

typedef long long ll;
using namespace std;

int main() {
	cin.tie(0); //?????±?????????????????????
	ios::sync_with_stdio(false); //printf??¨??±??????????????????
	string str;
	while (getline(cin, str)) {
		for (int i = -26; i <= 26; i++) {
			string newstr = str;
			for (int j = 0; j < str.size(); j++) {
				if ('a' <= newstr[j] && newstr[j] <= 'z') {
					newstr[j] = str[j] + i;
					if (newstr[j] > 'z') {
						newstr[j] -= 'z';
						newstr[j] += 'a';
					}
				}
			}
			//cerr << newstr << endl;
			if (newstr.find("the", 0) != string::npos ||
					newstr.find("this", 0) != string::npos ||
					newstr.find("that", 0) != string::npos) {
				cout << newstr << endl;
				break;
			}
		}
	}
	return 0;
}