Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	for scanner.Scan() {
		var result string
		line := scanner.Text()
		key := make(map[string]string)

		var i int32
		for ; i < 52; i++ {
			makeKey(key, i)
			result = decode(key, line)

			if strings.Contains(result, "the") {
				break
			} else if strings.Contains(result, "this") {
				break
			} else if strings.Contains(result, "that") {
				break
			}
		}

		fmt.Println(result)
	}
}

func makeKey(key map[string]string, shift int32) {
	for i := 'a'; i <= 'z'; i++ {
		cipher := (i + shift)
		if cipher > 'z' {
			cipher = cipher%'z' + 'a' - 1
		} else if cipher < 'a' {
			cipher = cipher + ('z' - 'a') + 1
		}
		key[string(i)] = string(cipher)
	}
}

func decode(key map[string]string, cipher string) string {
	var result string
	for _, v := range cipher {
		if key[string(v)] != "" {
			result += key[string(v)]
		} else {
			result += string(v)
		}
	}
	return result
}

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() {
	getline( cin, str );
	while ( true ){
		for ( int j = 0; j < str.size(); j++ ) {
			if ( str[ j ] >= 'a' && str[ j ] <= 'z' ) {
				str[ j ]++;
				str[ j ] = ( ( str[ j ] - 'a' ) % 26 ) + 'a';
			}
		}
		bool is_can = false;
		for ( int j = 0; j < str.size() - 2; j++ ) {
			if ( str.substr( j, 3 ) == "the" ) {
				is_can = true;
				break;
			}
		}

		if ( is_can ) {
			break;
		}
		for ( int j = 0; j < str.size() - 3; j++ ) {
			if ( str.substr( j, 4 ) == "that" || str.substr( j, 4 ) == "this" ) {
				is_can = true;
				break;
			}
		}
		if ( is_can ) {
			break;
		}

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

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;
      }
      if (m != 1) {
        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<iostream>
#include<string>
#include<sstream>
#include<vector>


std::vector<std::string> split(const std::string &s, char delim) {
	std::vector<std::string> elems;
	std::stringstream ss(s);
	std::string item;
	while (std::getline(ss, item, delim)) {
		if (!item.empty()) {
			elems.push_back(item);
		}
	}
	return elems;
}

int main() {
	std::string input;
	while (std::getline(std::cin, input)) {
		std::vector<std::string> words;
		bool isPeriod = false, isCipher = false;
		if (*(input.rbegin()) == '.') {
			input.pop_back();
			isPeriod = true;
		}
		words = split(input, ' ');
		for (int i = 0; i < 26; i++) {
			for (std::vector<std::string>::iterator itr = words.begin(); itr != words.end(); itr++) {
				for (std::string::iterator sitr = (*itr).begin(); sitr != (*itr).end(); sitr++) {
					*sitr = ((*sitr - 'a' + 1) % 26) + 'a';
				}
				if (*itr == "the" || *itr == "this" || *itr == "that") {
					isCipher = true;
				}
			}
			if (isCipher) break;
		}
		std::string output = "";
		for (std::vector<std::string>::iterator itr = words.begin(); itr != words.end(); itr++) {
			if (output != "") output += " ";
			output += *itr;
		}
		if (isPeriod) output += ".";
		std::cout << output << std::endl;
	}
}

C++:  
 #include<iostream>
 #include<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 #include<stack>
 
 using namespace std;
  
 int main()
 {
   string a,b;
   while(getline(cin,a))
   {
     for(int shift=1;shift<26;shift++)
     {
       b="";
       for(int i=0;i<a.length();i++)
       {
         if(a[i]>='a'&&a[i]<='z')
         { 
           if(a[i]+shift>'z') b+=(a[i]+(shift-26));
           else b+=(a[i]+shift);
         }         
         else b+=a[i]; 
       }
       if(b.find("the")!=string::npos||b.find("this")!=string::npos||b.find("that")!=string::npos) break;
       else continue;
     }             
     cout<<b<<endl;
   }
   //while(1);      
   return 0;    
 }

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

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

C++: #include <bits/stdc++.h>

using namespace std;

#define FOR(i, j, k) for(int i = j; i < k; ++i)
#define rep(i, j) FOR(i, 0, j)
#define repr(i, j) for(int i = j; i >= 0; --i)
#define INF (1 << 30)
#define MOD 1e9 + 7

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;

int main() {
	string s;
	string ans;
	bool flag = false;
	int key = 1;
	while(getline(cin, s)){ans += s;}
	while(1) {
		rep(i, ans.size()) {
			if(97 <= ans[i] && ans[i] <= 122) {
				int number = (ans[i] - 'a' + key) % 26;
				ans[i] = 'a' + number;
			}
		}
		string tmp;
		rep(i, ans.size()) {
			if(97 <= ans[i] && ans[i] <= 122) tmp += ans[i];
			else if(ans[i] == ' ') {
				if(tmp == "this" || tmp == "the" || tmp == "that") flag = true;
				else tmp.erase(tmp.begin(), tmp.end());
			}
		}
		if(flag) break;
	}
	cout << ans << endl;
	return 0;
}