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;
int caesar(char s[]);
bool search(string s);

int main(){
	string str;
	int i;
	while(getline(cin,str)){
		int j=0;
		while(!search(str)){
			for(i=0;str[i]!='.';i++){
				if(str[i]!=' ') str[i]++;
				if(str[i]>122) str[i]=97;
			}
			j++;
			if(j>25) break;
		}
		cout << str << endl;
	}
	return 0;
}

bool search(string s){
	if(s.find("this")!=string::npos) return true;
	if(s.find("that")!=string::npos) return true;
	if(s.find("the")!=string::npos) return true;
	return false;
}

C++: #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define shosu(n) setprecision(n)
#define INF 1000000000;
using namespace std;
int main() {
  string n;
  while (getline(cin, n)) {
    string ans = n;
    for (int i = 0; i < 26; i++) {
      if (ans.find("the") != -1 || ans.find("that") != -1 ||
          ans.find("this") != -1)
        break;
      for (int j = 0; j < ans.size(); j++) {
        if (ans[j] == ' ' || ans[j] == '.')
          continue;
        if (ans[j] == 'z')
          ans[j] = 'a';
        else
          ans[j]++;
      }
    }
    cout << ans << endl;
  }
  return 0;
}

C++: #include<bits/stdc++.h>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<algorithm>
using namespace std;

#define PI 3.1415926535897932
// #54797
int main(){
    int len,flg;
    char s[84];
    while (fgets(s,84,stdin)!=NULL) {
        len=strlen(s)-1;
        flg=1;

        while (flg) {
            for (int i=0;i<len;i++) {
                if (islower(s[i])) {
                    s[i]=(s[i]-'a'+1)%26+'a';
                }
            }
            for (int i=0;i<len;i++) {
                if (!strncmp(&s[i],"the",3) || !strncmp(&s[i],"this",4) || !strncmp(&s[i],"that",4)) {
                    flg=0;
                    break;
                }
            }
        }
        printf("%s",s);
    }
    return 0;
}

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

bool howMuchWords(string s, string key){
  string::size_type index = s.find(key);
  if(index == string::npos){
    return false;
  }else{
    //???????????£???.
    return true;
  }
}
    

int main(){
  string s;
  getline(cin ,s);
  int cnt=0;
  
  
  while(true){
    bool flag=false;
    for(int i=0;i<s.length();i++){
      string key1 = s.substr(i,3);
      string key2 = s.substr(i,4);
    // if(howMuchWords(s, "that") || howMuchWords(s, "this") || howMuchWords(s, "the")){
      // cout << cnt << ": ";
      // cout << s << endl;
      // break;
      if(key1 == "the" || key2 == "this" || key2 == "that"){
	flag = true;
	break;
      }
    }
    
    if(flag){
      cout << s << endl;
      break;
    }
    
    for(int i=0;i<s.length();i++){
      if(s[i] > 'a' && s[i] < 'z'){
	s[i] -= 'a';
	s[i] -= 1;
	if(s[i] < 0){
	  s[i] += 'A' - 'a';
	}
	s[i] += 'a';
      }
    }
    
  }
}

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

std::string str;

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

	return 0;
}

C++: //include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef unsigned long long ULL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int main() {
  int n;
  string str;
  
  getline(cin, str);

  for(int i = 0; i < str.size(); i++) {
    for(int j = 0; str[i]+j <= 'z'; j++) {
      if(str[i] + j == 't' && str[i+1] + j == 'h') {
	n = j;
	break;
      }
    } 
    for(int j = 0; str[i]-j >= 'a'; j++) {
      if(str[i] - j == 't' && str[i+1] - j == 'h') {
	n = -j;
	break;
      }
    }
  }
  
  for(int i = 0; i < str.size(); i++) {
    if(str[i] == ' ' || str[i] == '.') printf("%c", str[i]);
    else printf("%c", str[i]+n);
  }
  cout << endl;
}

C++: #define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>

using namespace std;

int main()
{
	string str;
	//while(getline(cin,str)){
	getline(cin,str);
		for(int rot = 0;rot< 'z' - 'a' + 1;rot++){
			string tmp = str;
			for(int i=0; i<str.size() - 1; i++){
				if(tmp[i] == ' ') continue;
				tmp[i] = (rot + tmp[i]-'a') % ('z' - 'a' + 1) + 'a';
			}
			//cout << tmp << endl;
			if(tmp.find("the") != string::npos
				|| tmp.find("this") != string::npos
				|| tmp.find("that") != string::npos)
			{
				cout << tmp << endl;
			}
		}
	//}
	return 0;
}

C++: #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int caesar(char s[]);
bool search(char s[]);

int main(){
	char s[256];
	int i,j=0,n=10;
	scanf("%[^\n]",&s);
	while(!search(s)){
		for(i=0;s[i]!='.';i++){
			if(s[i]!=' ') s[i]++;
			if(s[i]>122) s[i]=97;
		}
	}
	printf("%s\n",s);
	return 0;
}

bool search(char s[]){
	char *is,*e,*at;
	char *tmp;
	is="this";e="the";at="that";
	tmp = strchr(s,is[0]);
	if(tmp==NULL) return false;
	while(tmp[0]!=NULL){
		if(!strncmp(tmp,is,4))	return true;
		if(!strncmp(tmp,e,4))	return true;
		if(!strncmp(tmp,at,3))	return true;
		tmp++;
	}
	return false;
}