Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func cipher(text string, direction int, int_shift int) string {
	shift, offset := rune(int_shift), rune(26)
	runes := []rune(text)
	for index, char := range runes {
		switch direction {
		case 1:
			if char >= 'a' && char <= 'z'-shift || char >= 'A' && char <= 'Z'-shift {
				char = char + shift
			} else if char > 'z'-shift && char <= 'z' || char > 'Z'-shift && char <= 'Z' {
				char = char + shift - offset
			}
		case -1:
			if char >= 'a'+shift && char <= 'z' || char >= 'A'+shift && char <= 'Z' {
				char = char - shift
			} else if char >= 'a' && char < 'a'+shift || char >= 'A' && char < 'A'+shift {
				char = char - shift + offset
			}
		}
		runes[index] = char
	}
	return string(runes)
}

func main() {
	for {
		infos := strings.Split(nextString(), " ")
		plain := make([]string, len(infos))
		if reflect.DeepEqual(infos, []string{}) {
			break
		}
		fmt.Println(infos)
		Decryption:
			for i := 0; i < 26; i++ {
				for j := range infos {
					plain[j] = cipher(infos[j], 1, i)
				}
				for j := range plain {
					if plain[j] == "this" || plain[j] == "that" || plain[j] == "the" {
						break Decryption
					}
				}
			}
			fmt.Println(strings.Join(plain, " "))
	}
}

C++: #include <bits/stdc++.h>
using namespace std;

//#define int long long
#define reps(i,s,n) for(int (i)=(s);(i)<(n);++(i))
#define rep(i,n) reps(i,0,n)
#define rept(i,n) rep(i,(n)+1)
#define repst(i,s,n) reps(i,s,(n)+1)
#define reprt(i,n,t) for(int (i)=(n);(i)>=(t);--(i))
#define repr(i,n) reprt(i,n,0)
#define each(itr,v) for(auto &(itr):(v))
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define tmax(x,y,z) max(x,max(y,z))
#define tmin(x,y,z) min(x,min(y,z))
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define ln '\n'
#define bln(i,n) (((i)==(n)-1)?'\n':' ')
#define dbg(x) cout<<#x" = "<<(x)<<ln<<flush
#define dbga(x,n) {cout<<#x" : ";for(int (i)=0;i<(n);++i){cout<<((x)[i])<<(i==((n)-1)?'\n':' ')<<flush;}}
#define zero(a) memset(a,0,sizeof(a))
#define unq(a) sort(all(a)),a.erase(unique(all(a)),a.end())

typedef complex<double> P;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<string> vst;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<vector<int> > mat;

const ll inf = (ll)1e9+10;
const ll linf = (ll)1e18+10;
const ll mod = (ll)(1e9+7);
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};
const double eps = 1e-10;

ll mop(ll a,ll b,ll m=mod) {ll r=1;a%=m;for(;b;b>>=1){if(b&1)r=r*a%m;a=a*a%m;}return r;}
ll gcd(ll a,ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b) {return a*b/gcd(a,b);}
bool ool(int x,int y,int h,int w) {return((x<0)||(h<=x)||(y<0)||(w<=y));}
bool deq(double a,double b) {return abs(a-b)<eps;}

struct oreno_initializer {
	oreno_initializer() {
		cin.tie(0);
		ios::sync_with_stdio(0);
	}
} oreno_initializer;

// ━━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…
// .｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋
// ・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・

typedef string::const_iterator S;
string s;

//(t.size()>=3 && t.substr(0,3)=="the") || (t.size()>=4 && (t.substr(0,4)=="that" || t.substr(0,4)=="this"))

bool ok(S &i, S &e) {
	if (i==e) return 0;
	string t;
	while (*i!=' ') t.pb(*i), i++;
	if (t=="the" || t=="this" || t=="that") return 1;
	return ok(++i,e);
}

signed main() {
	while (getline(cin,s)) {
		if (s.empty()) break;
		s.pb(' ');
		rep(i,26) {
			S b = s.begin(), c = s.end();
			if (ok(b,c)) {
				cout << s.substr(0,s.size()-1) << ln << flush;
				break;
			}
			rep(j,s.size()) if ('a'<=s[j] && s[j]<='z') {
				s[j]++;
				if (s[j]>'z') s[j] = 'a';
			}
		}
	}
}

C++: #include <iostream>
#include <vector>
#include <cstdio>

//2^32/26 = 165191049.846153846153846 = 165191050
#define MAGIC 0x9D89D8A

char shift (char c, int amount)
{
    long n;
    long q ;
    long r;
    
    n = (long) c - 'a' +  amount;
    q = n * MAGIC;
    q >>= 32;
    r = n - q * 26;
    
    return (char) 'a' + r;
}

void shiftString (char* s, int amount)
{
    int i = 0;
    while (s[i]) {
        
        if (s[i] == ' ') {}
        else if (s[i] == '.') {}
        else { s[i] = shift(s[i], amount); }
        i++;
    }
    
}

int main(int argc, const char * argv[]) {

   
    char input[256];
    std::string line;
    int result = 0;
    std::size_t found;
   
    
    while (std::getline(std::cin, line))
    {
        sprintf(input, "%s", line.c_str());
    }
    
    
   
    while (!result)
    {
  
        shiftString(input, -1);
        line = input;
        
        result = 0;
        
        found = line.find("the");
        result += found!=std::string::npos;
        
        found = line.find("this");
        result += found!=std::string::npos;

        found = line.find("that");
        result += found!=std::string::npos;

    }
    
    printf("%s", input);

    return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
bool isAlpha(char c){
	return ('a' <= c && c <= 'z');
}
bool isShift(char c1, char c2, int v){
	return (int(c1 - 'a') == int(c2 + v - 'a') % 26);
}
int getShiftVal(string& line){
	int s = line.size();
	string::size_type ps = 0, pe = 0;
	while (true){
		while (ps < s && !isAlpha(line[ps])) ++ps;
		pe = ps;
		while (pe < s && isAlpha(line[pe])) ++pe;
		if (ps >= s || pe >= s)
			break;
		int len = pe - ps;
		if (3 == len){
			if (isShift(line[ps], line[ps + 1], 12) && isShift(line[ps], line[ps + 2], 15)){
				return int('t' - char(line[ps]));
			}
		}
		else if (4 == len){
			if (isShift(line[ps], line[ps + 1], 12) && isShift(line[ps], line[ps + 2], 11) && isShift(line[ps], line[ps + 3], 1)){
				return int('t' - char(line[ps]));
			}
			else if (isShift(line[ps], line[ps + 1], 12) && isShift(line[ps], line[ps + 2], 19) && isShift(line[ps], line[ps + 3], 0)){
				return int('t' - char(line[ps]));
			}
		}
		ps = pe;
	}
	return -1;
}

int main()
{
	string line;
	while (std::getline(cin, line)){
		int s = line.size();
		int v = getShiftVal(line);
		for (int i = 0; i < s; ++i){
			char c = line[i];
			if (isAlpha(c)) cout << char(c + v);
			else cout << c;
		}
		cout << "\n";
	}
	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;
    while(getline(cin, s)){
    	rep(i, 26) {
	    	rep(j, s.size()) {
	            if(97 <= s[i] && s[i] <= 122) s[j] = s[j] + 'a';
	            else s[j] = 'a';
	        }
	        if(s.find("the") != string::npos || s.find("this") != string::npos || s.find("that") != string::npos){
                cout << s << endl;
            }
	    }
    }
    return 0;
}