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 ll long long
#define ull unsigned long long
#define pi acos(-1)
#define MIN(a,b) (a < b ? a : b)
#define MAX(a,b) (a > b ? a : b)
int main()
{
	char s[100],ch;
	int len,i,j,x,y,z,shift,m,c,shift1,shift2,shift3,shift4,shift5,shift6;
	while(gets(s)){
		len=strlen(s);
		c=0;
		for(i=0;i<len;i++){
			if(s[i]>='a'&&s[i]<='z'){
				c++;
			}
			else{
				if(c==3||c==4){
					//printf("c:%d\n",c);
					if(c==3){
						shift1=abs(s[i-3]-'t');
						shift2=abs(s[i-2]-'h');
						shift3=abs(s[i-1]-'e');
						if(shift1==shift2&&shift2==shift3){
							shift='t'-s[i-3];
							printf("%c\n",s[i-3]);
							break;
						}
					}
					if(c==4){
						shift1=abs(s[i-4]-'t');
						//printf("%d %d\n",s[i-3],'t');
						shift2=abs(s[i-3]-'h');
						shift3=abs(s[i-2]-'i');
						shift4=abs(s[i-1]-'s');
						shift5=abs(s[i-2]-'a');
						shift6=abs(s[i-1]-'t');
						//printf("%d %d %d %d %d %d\n",shift1,shift2,shift3,shift4,shift5,shift6);
						if((shift1==shift2&&shift2==shift3&&shift3==shift4)||(shift1==shift2&&shift2==shift5&&shift5==shift6)){
							//printf("%d\n",s[i]);
							shift='t'-s[i-4];
							break;
						}
					}
				}
				c=0;
			}
		}
		//printf("%d\n",shift);
		for(i=0;i<len;i++){
			if(s[i]>='a'&&s[i]<='z'){
				m=s[i]-96;
				//printf("m:%d m+shift:%d\n",m,m+shift);
				if(m+shift>26)s[i]=(m+shift-26)+96;
				else if(m+shift<1)s[i]=96+(26+m+shift);
				else s[i]=96+m+shift;
			}
		}
		for(i=0;i<len;i++){
			printf("%c",s[i]);
		}
		printf("\n");
		memset(s,0,sizeof(s));
	}
	return 0;
}

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

int main() {
  string str;
  while(getline(cin,str)){
    for(int i = 0;i < 26;i++){
      for(int i = 0;i <str.size();i++){
        if(isalpha(str[i]))
          str[i] = (str[i]=='z')? 'a' : str[i] + 1;
      }
      if(str.find("the") !=string::npos||str.find("that") !=string::npos||
         str.find("this") !=string::npos){
        cout <<str<<endl;
        break;
      }
    }
  }
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <list>
#include <algorithm>
#include <cmath>
#include <stack>
#include <set>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define FOR(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define PUSH(n,v) for(int i=0; i<(n); i++) {int j; cin >> j; v.push_back(j);}
#define ALL(v) v.begin(), v.end()

void rot1(string &s) {
    string t = "";
    REP(i,s.size()) {
        if (s[i] >= 'a' && s[i] <= 'z') {
            if (s[i] == 'a') t += "z";
            else t += s[i] - 1;
        }else {
            t += s[i];
        }
    }
    s = t;
}

int main() {
    string s;
    while(getline(cin, s)) {
        while(s.find("the") == string::npos && s.find("this") == string::npos && s.find("that") == string::npos) {
            rot1(s);
        }
        cout << s << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
//#include <regex>
#include <cctype>
#include <string>
#include <utility>
using namespace std;

vector<string> v;
/*
vector<string> split(string&& s, regex&& pattern) {
    sregex_token_iterator first(s.begin(), s.end(), pattern, -1);
    sregex_token_iterator last;
    return(vector<string>(first, last));
}
*/
bool cheser() {
    for(int r = 1; r <= 26; r++) {
        bool found = false;
        for(int c = 0; c < v.size(); c++) {
            for(int k = 0; k < v[c].length(); k++) {
                if(!isalpha(v[c][k])) continue;
                int now = v[c][k] - 'a';
                now = (now+1)%26;
                v[c][k] = 'a' + now;
            }
            if(v[c] == "the" || v[c] == "this" || v[c] == "that") found = true;
        }
        if(found) return(true);
    }
    return(false);
}

int main(void) {
    string input;
    while(getline(cin, input)) {
       // v = split(move(input), regex(" "));
        cheser();
        for(int r = 0; r < v.size(); r++) {
            cout << v[r];
            if(r == v.size() - 1) cout << endl;
            else                  cout << " ";
        }
    }
    
    return(0);
}

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

#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
#define OP(m) cout << m << endl;
typedef long long ll;
typedef unsigned long long ull;

int main()
{
    string text;
    while (getline(cin, text))
    {
        while (text.find("the") == string::npos && text.find("this") == string::npos && text.find("that") == string::npos)
        {
            rep(i, text.size())
            {
                if (text[i] != ' ' && text[i] != '.')
                {
                    if (text[i] != 'z')
                        text[i]++;
                    else
                    {
                        text[i] = 'a';
                    }
                }
            }
        }
        OP(text)
    }
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
vector<string> split(string &s, char delimiter){
  vector<string> res;
  int prev_split_point = 0;
  for (int i = 0; i < s.length(); i++) {
    while(s[i] != delimiter && i < s.length())i++;
    string add = s.substr(prev_split_point, i - prev_split_point);
    if(!add.empty())res.push_back(add);
    prev_split_point = i + 1;
  }
  return res;
}

int main(int argc, char *argv[]){
  char c[26];
  for (int i = 0; i < 26; i++) {
    c[i] = 'a' + i;
  }
  vector<string> vs;
  string s;
  string ans[] = {"this", "that", "the"};
  vector<string> tmp;
  while(getline(cin, s)){
    vs = split(s, ' ');
    int n = vs.size();
    for (int k = 0; k < 26; k++) {
      tmp = vs;
      for (int i = 0; i < vs.size(); i++) {
        for (int j = 0; j < vs[i].length(); j++) {
          if('a' <= tmp[i][j] && tmp[i][j] <= 'z')
            tmp[i][j] = c[(vs[i][j] - 'a' + k) % 25];
        }
      }
      for (int i = 0; i < 3; i++) {
        for (int j = 0; j < tmp.size(); j++) {
          if(tmp[j] == ans[i]){k = 50, i = 10, j = 1000;}
        }
      }
    }
    for (int i = 0; i < tmp.size(); i++) {
      std::cout << tmp[i];
      if(i == tmp.size() - 1)std::cout << std::endl;
      else std::cout << " ";
    }
  }
  return 0;
}

C++: #include<iostream>
#include<string>
#include<cmath>
int main(){std::string s;while(std::getline(std::cin,s)){char b[81],*p,*c;c=b;strcpy(b,s.c_str());int gap=0;do{p=strtok(c," .\n");if(p!=NULL){int l=strlen(p);if(l>=3&&p[0]-p[1]=='t'-'h'){if(l==3){if(p[0]-p[2]=='t'-'e'){gap='t'-p[0];break;}}else if(l==4){if(p[0]-p[2]=='t'-'i'&&p[0]-p[3]=='t'-'s'){gap='t'-p[0];break;}else if(p[0]-p[2]=='t'-'a'&&p[0]-p[3]==0){gap='t'-p[0];break;}}}}c=NULL;}while(p!=NULL);for(std::string::iterator it=s.begin();it!=s.end();++it){if(*it!=' '&&*it!='.'&&*it!='\n'){std::cout<<static_cast<char>(*it+gap);}else{std::cout<<*it;}}}}