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 <iostream>
#include <string>

using namespace std;

int main() { 
  string input_str;

  while (getline(cin, input_str)) {
    for (int shift = 0; shift < 26; shift++) {
      for (int str_i = 0; str_i < input_str.size(); str_i++) {
        if (input_str[str_i] >= 'a' && input_str[str_i] < 'z')
          input_str[str_i] ++;
        else if (input_str[str_i] == 'z')
          input_str[str_i] = 'a';
      }
      if (input_str.find("the") != string::npos || input_str.find("this") != string::npos || input_str.find("that") != string::npos)
        break;
    }
    cout << input_str << endl;
  }

  return 0;
}

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

2.using namespace std;

3.//????????????????????????????????????

4.void Check(const string& str){

5.  string strparent=str;

6.  int gap=1;

7.  while(strparent.find("the")==(string::npos)&&

8.        strparent.find("this")==(string::npos)&&

9.        strparent.find("that")==(string::npos)){

10.    for(int i=0;i<str.length();i++){

11.      if(!isalpha(str[i]))continue;//" "

12.      //strparent[i]=(gap+str[i]-'a')%26+'a';

13.      strparent[i]=(gap+str[i])%26+'a';

14.    }

15.    gap++;

16.  }

17.  cout<<strparent<<endl;

18.}

19. 

20.int main(){

21.  string str;

22.  while(getline(cin,str)){

23.    Check(str);

24.  }

25.}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)
int diff(char c, char base) {
    return (c-base+26)%26;
}
int conv(char c, int d) {
    return (c-d-'a'+26)%26+'a';
}
int main(void){
    string s;
    while(getline(cin, s)) {
        int d;
        rep(i, s.size()) {
            if(i<s.size()-3 &&
                    (diff(s[i], 't') == diff(s[i+1], 'h') &&
                     diff(s[i], 't') == diff(s[i+2], 'i') &&
                     diff(s[i], 't') == diff(s[i+3], 's')) || 
                    (diff(s[i], 't') == diff(s[i+1], 'h') &&
                     diff(s[i], 't') == diff(s[i+2], 'a') &&
                     diff(s[i], 't') == diff(s[i+3], 't'))) {
                d = diff(s[i], 't');
                break;
            }
            if(i<s.size()-2 &&
                    (diff(s[i], 't') == diff(s[i+1], 'h') &&
                     diff(s[i], 't') == diff(s[i+2], 'e'))) {
                d = diff(s[i], 't');
                break;
            }
        }
        rep(i, s.size()) {
            if(s[i] >='a' && s[i]<='z') s[i] = conv(s[i], d);
        }
        cout << s << endl;
    }
}

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

using namespace std;

int main() {
	string str, str2, ans;
	int i, j, l, n = 0;
	while (cin >> str) {
		ans += str;
		ans += ' ';
		if (n != 0) {
			continue;
		}
		l = str.length();
		str2.resize(l);
		for (i = 1; i < 26; i++) {
			for (j = 0; j < l; j++) {
				if (str[j] == '.') {
					continue;
				}
				if (str[j] + i > 'z') {
					str2[j] = str[j] - 26 + i;
				}
				else {
					str2[j] = str[j] + i;
				}
			}
			if (str2 == "the" || str2 == "the." || str2 == "this" || str2 == "this." || str2 == "that" || str2 == "that.") {
				n = i;
				break;
			}
		}
	}
	l = ans.length();
	ans.erase(l - 1);
	for (i = 0; i < l; i++) {
		if (ans[i] == '.' || ans[i] == ' ') {
			continue;
		}
		if (ans[i] + n > 'z') {
			ans[i] = ans[i] - 26 + n;
		}
		else {
			ans[i] = ans[i] + n;
		}
	}
	cout << ans << endl;
	return 0;
}

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

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repc(i, n) for (int i = 0; i <= int(n); i++)
#define rrepc(i, n) for (int i = int(n); i >= 0; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define repic(i, a, b) for (int i = int(a); i <= int(b); i++)
#define each(x, y) for (auto &x : y)
#define all(a) (a).begin(), (a).end()
#define bit(b) (1ll << (b))

using namespace std;

using i32 = int;
using i64 = long long;
using u64 = unsigned long long;
using f80 = long double;
using vi32 = vector<i32>;
using vi64 = vector<i64>;
using vu64 = vector<u64>;
using vf80 = vector<f80>;
using vstr = vector<string>;

inline void yes() { cout << "Yes" << '\n'; exit(0); }
inline void no() { cout << "No" << '\n'; exit(0); }
inline i64 gcd(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); if (a % b == 0) return b; return gcd(b, a % b); }
inline i64 lcm(i64 a, i64 b) { return a / gcd(a, b) * b; }
inline u64 xorshift() { static u64 x = 88172645463325252ull; x = x ^ (x << 7); return x = x ^ (x >> 9); }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; }
template <typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template <typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template <typename T> inline void amax(T &x, T y) { if (x < y) x = y; }
template <typename T> inline void amin(T &x, T y) { if (x > y) x = y; }
template <typename T> inline T power(T x, i64 n, T e = 1) { T r = e; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template <typename T> istream& operator>>(istream &is, vector<T> &v) { each(x, v) is >> x; return is; }
template <typename T> ostream& operator<<(ostream &os, vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }
template <typename T, typename S> istream& operator>>(istream &is, pair<T, S> &p) { is >> p.first >> p.second; return is; }
template <typename T, typename S> ostream& operator<<(ostream &os, pair<T, S> &p) { os << p.first << ' ' << p.second; return os; }

void solve() {
  string s;
  while (getline(cin, s)) {
    rep(i, 26) {
      string t = s;
      map<char, char> ma;
      rep(j, 26) {
        char src = 'a' + j;
        char dst = 'a' + (j + i) % 26;
        ma[src] = dst;
      }
      int n = t.size();
      rep(j, n) {
        if (t[j] >= 'a' && t[j] <= 'z') t[j] = ma[t[j]];
      }
      bool f = false;
      for (int i = 0; i + 3 <= n; i++) {
        if (t.substr(i, 3) == "the") f = true;
      }
      for (int i = 0; i + 4 <= n; i++) {
        if (t.substr(i, 4) == "this") f = true;
      }
      for (int i = 0; i + 4 <= n; i++) {
        if (t.substr(i, 4) == "that") f = true;
      }
      if (f) {
        cout << t << '\n';
        break;
      }
    }
  }
}

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

int main()
{
	char str[90];
	
	fgets( str, 81, stdin );
	
	while( 1 ){
		for( int i = 0; i < strlen( str ); i++ ){
			if( isalpha( str[i] ) ) str[i]++;
			
			if( str[i] > 'z' ){
			 	str[i] = 'a';
			}
		}
		
		if( strstr( str, "the" ) != NULL || strstr( str, "this" ) != NULL || strstr( str, "that" ) != NULL ) break;
	}
	
	std::cout << str << std::endl;

 	return 0;
}