Go: package main

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

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 len(infos) == 0 {
			break
		}
		// 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
//------------------------------------------
#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;
}

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

int main(){
	string str[80];
	int shi_rate;
	int p;
	bool flag, shifted;
	
	p = 0;
	flag = false;
	shifted = false;
	while(!flag){
		cin >> str[p];
		
		if(str[p][str[p].size() - 1] == '.') flag = true;
		
		if(!flag && !shifted){
			if(str[p].size() == 3){
				if(str[p][2] - str[p][1] == -3 && str[p][0] - str[p][1] == 12){
					shi_rate = str[p][0] - 116;
					shifted = true;
				}
			}
			else if(str[p].size() == 4){
				if(str[p][0] - str[p][1] == 12 &&
				 ((str[p][0] == str[p][3] && str[p][3] - str[p][2] == 19) ||
				  (str[p][3] - str[p][2] == 10 && str[p][2] - str[p][1] == 1))){
					shi_rate = str[p][0] - 116;
					shifted = true;
				}
			}
		}
		else if(flag && !shifted){
			if(str[p].size() == 4){
				if(str[p][2] - str[p][1] == -3 && str[p][0] - str[p][1] == 12){
					shi_rate = str[p][0] - 116;
					shifted = true;
				}
			}
			else if(str[p].size() == 5){
				if(str[p][0] - str[p][1] == 12 &&
				 ((str[p][0] == str[p][3] && str[p][3] - str[p][2] == 19) ||
				  (str[p][3] - str[p][2] == 10 && str[p][2] - str[p][1] == 1))){
					shi_rate = str[p][0] - 116;
					shifted = true;
				}
			}
		}
		p++;
	}
	
	for(int i = 0; i <= p; i++){
		for(int j = 0; j < str[i].size(); j++){
			if(str[i][j] != '.') cout << (char)(str[i][j] - shi_rate);
			else cout << '.';
		}
		if(i < p) cout << " ";
		else cout << endl;
	}
	
	return 0;
}

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

using namespace std;

string abc = "abcdefghijklmnopqrstuvwxyz";

int main() {
    string s;
    while (getline(cin, s)) {
        for (int i=0; i<26; ++i) {
            string ns = "";
            bool ok = false;
            for (int j=0; j<(int)s.size(); ++j) {
                if (s[j] == '.' || s[j] == ' ') {
                    ns += s[j];
                } else {
                    ns += abc[(s[j] - 'a' + i) % 26];
                    if (0 <= j-2 && ns.substr(j-2) == "the")  ok = true;
                    if (0 <= j-3 && ns.substr(j-3) == "this") ok = true;
                    if (0 <= j-3 && ns.substr(j-3) == "that") ok = true;
                }
            }
            if (ok) {
                cout << ns << endl;
                break;
            }
        }
    }
    return 0;
}

C++: // #733568 Solution for 0017: Caesar Cipher by rabbit_TR
//reason I want to see test case.

#include <iostream>
#include <string>
using namespace std;

int main() {

  string input;

  while(true) {
    if ( cin.eof() ) break;

    getline( cin, input );

    char c;
    for ( int i = 0; i < 26; i++ ) {

      string ans = "";
      for ( int j = 0; j < input.size(); j++ ) {

        c = input[j];
        if ( c >= 'a' && c <= 'z' ) {
          c = 'a' + ( c - 'a' + i )%26 ;
        }
        ans += c;

      }

      if ( ans.find( "the", 0 ) == string::npos && ans.find( "this", 0 ) == string::npos && ans.find( "that", 0 ) == string::npos ) continue;

      cout << ans << endl;

      break;

    }

  }

  return 0;

}