Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

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 scanner.Scan() {
		infos := strings.Split(scanner.Text(), " ")
		plain := make([]string, len(infos))
		// 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 <iostream>
#include <string>
using namespace std;
int main() {
  string line;
  while (getline(cin, line)) {
    while (line.find("the") == string::npos && line.find("this") == string::npos
      && line.find("that") == string::npos)
      for (auto& c : line)
        if (c == 'a') c = 'z';
        else if (c != '.' && c != ' ') c -= 1;
    cout << line << endl;
  }
}

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

const int ALPHA = 26;

int main(){
	string input;
	while(cin && getline(cin, input)){
		string cand[ALPHA];
		for(int i=0; i<ALPHA; i++){
			cand[i] = "";
			for(int n=0; n<input.size(); n++){
				if('a'<=input[n]&&input[n]<='z'){
					cand[i] += (input[n]-'a'+i)%ALPHA + 'a';
				} else {
					cand[i] += input[n];
				}
			}
			if(cand[i].find("the") != string::npos
				|| cand[i].find("this") != string::npos
				|| cand[i].find("that") != string::npos){
				cout<<cand[i]<<endl;
			}
		}
	}
	return 0;
}

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

int main(){
	string num;
	int t;
	while( getline(cin,num)){
		while(1){
			for(int i=0;num[i]!='\0';i++){
				if(num[i]=='a'){
					num[i]='z';
				}
				else if(num[i]>'a'&& num[i]<='z'){
					num[i]--;
				}
			}
			t=0;
			for(int i=0;num[i]!='\0';i++){
				if(num[i]=='t' && num[i+1]=='h'){
					if(num[i+2]=='e')t=1;
					if(num[i+2]=='i'&&num[i+3]=='s')t=1;
					if(num[i+2]=='a'&&num[i+3]=='t')t=1;
				}
			}
			if(t==1)break;
		}
		cout << num << "\n";
	}
	return 0;
}

C++: #include<iostream>
#include<string>
#include<string.h>
using namespace std;
bool search(string);
int main()
{
	string s;
	getline(cin, s);
	while (true){
		for (int i = 0; i < s.size(); i++){
			if (s[i] == 'a'){
				s[i] = 'z';
			}
			else if (s[i]>'a'&&s[i] <= 'z'){
				s[i]--;
			}
		}
		if (search(s)){
			cout << s << endl;
			break;
		}
	}
}
bool search(string s){
	string p[] = { { "the" }, { "this" }, { "that" } };
	for (int i = 0; i < s.size(); i++){
		if (s[i] == 't'){
			for (int j = 0; j < 3; j++){
				int count = 0;
				for (int i2 = i; i2 < i + p[j].size(); i2++,count++){
					if (p[j][count] != s[i2]){
						break;
					}
				}
				if (count == p[i].size()){
					return true;
				}
			}
		}
	}
	return false;
}

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;
    bool flag = false;
    int key = 1;
    while(getline(cin, s)){
    	while(s != "the" && s != "that" && s != "this") {
	    	rep(i, s.size()) {
	            if(97 <= s[i] && s[i] <= 122) {
	                int number = (s[i] - 'a' + key) % 26;
	                s[i] = 'a' + number;
	            }
	        }
	    }
	    cout << s << endl;
    }
    return 0;
}

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

using namespace std;

int main()
{
  string stro, str;
  while(getline(cin, stro)){
    for(int i = 1; i < 26; i++){
      str = stro;
      for(int j = 0; j < stro.length(); j++){
	if(str[j] != ' ' && str[j] != '.' && str[j] != '\n')
	  if(str[j] + i > 'z')
	    str[j] += i - 26;
	  else
	    str[j] += i;
      }

      if(str.find("the", 0) != string::npos || str.find("this", 0) != string::npos || str.find("that", 0) != string::npos)
	cout << str << endl;	
    }
  }
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
#include <vector>
#include <set>

using namespace std;
typedef long long LL;
static const double EPS = 1e-9;

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n) 

int main(void){  
  vector<string> words;
  string bf;
  int s = 0;
  while(cin>>bf) words.push_back(bf);
  REP(i,words.size()){
    if(words[i].size()==3||words[i].size()==4){
      REP(j,26){
        REP(k,words[i].size()){
          if(words[i][k] >= 'a' && words[i][k] <= 'z' )
            words[i].replace(k, 1, 1,
                'a' + ( words[i][k] + 1 - 'a')%('z'-'a'+1) );
        
          if(words[i] == "the"||words[i] == "this" || words[i] == "that")
            s = j;
        }
      }
    }
  }
  REP(i,words.size())
    REP(j,words[i].size())
      if(words[i][j] >= 'a' && words[i][j] <= 'z' )
        words[i].replace(j, 1, 1, 'a' + (words[i][j] + s+1 - 'a')%('z'-'a'+1) );
  cout << words[0];
  FOR(i,1,words.size())
    cout << " " << words[i];
  cout << endl;
}

C++: // clang-format off

#include <bits/stdc++.h>

#define int long long int
#define main signed main()
#define bye return 0
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define each(p, v) for (auto p = (v).begin(); p != (v).end(); p++)
#define all(v) (v).begin(), (v).end()
#define prec(n) fixed << setprecision(n)
#define dump(x) cerr << "(L" << __LINE__ << ") " << #x << " = " << (x) << endl
#define clr(x, a) memset(x, a, sizeof(x))

#define stlice(from, to) substr(from, (to) - (from) + 1)
#define odd(n) ((n) % 2)
#define even(n) (!odd(n))

#define INF 1000000000
#define INFLL 1000000000000000000LL
#define MOD 1000000007
#define PI acos(-1)

#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define vi vector<int>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define pii pair<int, int>

using namespace std;

// clang-format on

string f(string s) {
  rep(i, s.size()) {
    if ('a' <= s[i] && s[i] <= 'z') {
      s[i] = (s[i] - 'a' + 1) % ('z' - 'a') + 'a';
    }
  }
  return s;
}

main {
  string s;
  while (getline(cin, s)) {
    vs w;
    stringstream ss;
    ss << s;
    string x;
    while (ss >> x) {
      w.pb(x);
    }
    for (;;) {
      bool b = false;
      rep(i, w.size()) {
        string d = f(w[i]);
        b |= d.substr(0, 3) == "the" || d.substr(0, 4) == "this" ||
             d.substr(0, 4) == "that";
        w[i] = d;
      }
      if (b) {
        break;
      }
    }
    cout << w[0];
    loop(i, 1, w.size()) cout << ' ' << w[i];
    cout << endl;
  }
}