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 <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;
  }
}

C++: #include <iostream>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <map>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,b) FOR(i,0,b)
#define PB push_back
#define MP make_pair
int main(){
  string s;
  getline(cin,s);
  for(int i=0;i<26;i++){
    if(s.find("the")!=string::npos)break;
    if(s.find("that")!=string::npos)break;
    if(s.find("this")!=string::npos)break;
    for(int i=0;i<s.size();i++){
      if(!isalpha(s[i]))continue;
      s[i]++;
      if(s[i]>'z')s[i]-=26;
    }
  }
  cout<<s<<endl;
}

C++: #include <iostream>
#include <string>
using namespace std;
string rot(string s, int n){
	for(int i = 0; s[i] != '\0'; i++){
		if(s[i] >= 65 && s[i] <= 90) s[i] = (s[i] - 65 + n) % 26 + 65;
		else if(s[i] >= 97 && s[i] <= 122) s[i] = (s[i] - 97 + n) % 26 + 97;
	}
	return s;
}
// the this that
string text[3] = {"the", "this", "that"};
int main(){
	string line;
	while(getline(cin, line)){
		for(int i = 0; i < 26; i++){
			line = rot(line, 1);
			if(line.find(text[0], 0) != string::npos || line.find(text[1], 0) != string::npos || line.find(text[2], 0) != string::npos){
				cout << line << endl;
				break;
			}
		}
	}
	return 0;
}