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 <bits/stdc++.h>

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

using namespace std;

string key[3]={"the","this","that"};

string s,s2;

int main(){
	while(getline(cin,s)){
		bool flg=false;
		REP(c,'z'-'a'+1){
			s2=s;
			REP(i,s2.length()){
				if (s2[i]!=' ' && s2[i]!='.'){
					if ((int)s2[i]+c>'z'){
						s2[i]+='a'-'z'-1;
					}
					s2[i]+=c;
				}
			}
			REP(i,3){
				if (s2.find(key[i])!=string::npos){
					cout<<s2<<endl;
					flg=true;
					break;
				}
			}
			if (flg) break;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<sstream>

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()

using namespace std;

typedef unsigned int uint;
typedef long long ll;

struct inc{
  void operator() (char &c){
    if(isalpha(c)){
      if(islower(c))
	c = (((c - 'a') + 1) % ('z'-'a'+1)) + 'a';
      else
	c = (((c - 'A') + 1) % ('Z'-'A'+1)) + 'A';
    }
  }
};

int main(){
  string str;
  while(getline(cin, str)){
    bool f = true;
    while(f){
      for_each(str.begin(), str.end(), inc());
      stringstream ss(str);
      string tmp;
      while(ss>>tmp)
	if(tmp == "the" || tmp == "this" || tmp == "that" ||
	   tmp == "THE" || tmp == "THIS" || tmp == "THAT"){
	  cout << str << endl;
	  f = false;
	  break;
      }
    }
  }
  return 0;
}

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

int is_contain_keywords(string str,vector<string>& keywords) {
  int cnt = 0;
  vector<string>::iterator key_itr = keywords.begin();
  while(key_itr != keywords.end()) {
    if(str.find(*key_itr) != string::npos) {
      cnt++;
    }
    key_itr++;
  }
  return cnt;
}

string decode(string cipher) {
  vector<string> keywords;
  keywords.push_back("the");
  keywords.push_back("this");
  keywords.push_back("that");

  int remind_shift = -1;
  int max_cnt = 0;
  int str_len = cipher.length();
  for(int shift = 0;shift < 'z' - 'a';shift++) {
    string str = cipher;
    for(int i=0;i<str_len;i++) {
      if('a' < cipher[i] && cipher[i] < 'z') {
        str[i] = (cipher[i] - 'a' + shift) % ('z' - 'a') + 'a';
      }
    }
    if(is_contain_keywords(str,keywords) > max_cnt) {
      max_cnt = is_contain_keywords(str,keywords);
      remind_shift = shift;
    }
  }
  string ans = cipher;
  for(int i=0;i<str_len;i++) {
    if('a' < cipher[i] && cipher[i] < 'z') {
      ans[i] = (cipher[i] - 'a' + remind_shift) % ('z' - 'a') + 'a';
    }
  }
  return ans;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);

  string cipher;
  getline(cin,cipher);
  cout << decode(cipher) << endl;
}

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

const string alpha = "abcdefghijklmnopqrstuvwxyz";

int main()
{
  string s;
  while (getline(cin, s)) {

    for (int i = 0; i < 26; ++i) {
      for (unsigned int j = 0; j < s.size(); ++j) {
	if (isalpha(s[j]))
	  s[j] = alpha[(s[j]-'a'+1)%alpha.size()];
      }
      if (s.find("the", 0) != string::npos ||
	  s.find("this", 0) != string::npos ||
	  s.find("that", 0) != string::npos)
	break;
    }

    cout << s << endl;

  }
  return 0;
}

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

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

C++: #include <iostream>
#include <cstring>
#include <istream>

using namespace std;

int main(int argc, char **argv)
{
	char a[82], t;
	int n, p;
	
	while(cin.getline(a, 81, '\n')){
		n = strlen(a);
		for(int i = 0; i < n; i++){
			p = (int)(a[i++]-'t');
			if(a[i] == ' '){
				continue;
			}
			t = a[i++]-p;
			if(t < 'a'){
				t += 25;
			} else if(t > 'z'){
				t -= 25;
			}
			if(a[i] == ' '){
				continue;
			}
			if(t == 'h'){
				t = a[i++]-p;
				if(t < 'a'){
					t += 25;
				} else if(t > 'z'){
					t -= 25;
				}
				if(t == 'e' && a[i] == ' '){
					break;
				} else if(t == 'i'){
					t = a[i++]-p;
					if(t < 'a'){
						t += 25;
					} else if(t > 'z'){
						t -= 25;
					}
					if(t == 's' && a[i] == ' '){
						break;
					}
				} else if(t == 'a'){
					t = a[i++]-p;
					if(t < 'a'){
						t += 25;
					} else if(t > 'z'){
						t -= 25;
					}
					if(t == 't' && a[i] == ' '){
						break;
					}
				}
			}
		}
		
		for(int i = 0; i < n; i++){
			if(a[i] == ' ' || a[i] == '.' || a[i] == ','){
				printf("%c",a[i]);
			} else {
				t = a[i]-p;
				if(t < 'a'){
					t += 25;
				} else if(t > 'z'){
					t -= 25;
				}
				printf("%c",t);
			}
		}
		cout << endl;
	}
	
	return 0;
}

C++: #define _USE_MATH_DEFINES
#include <iostream>
#include <queue>
#include <vector>
#include <math.h>
#include <algorithm>
#include <iomanip>
#include <string>
#include <stack>
using namespace std;

int main(){
	string s;
	while(getline(cin, s)) {
		while (s.find("the") == string::npos && s.find("this") == string::npos && s.find("that") == string::npos) {
			for (int i = 0; i < s.length(); ++i) {
				if ('a' <= s[i] && s[i] <= 'z') {
					int c;
					c = (s[i] - 'a' + 1) % ('z' - 'a' + 1);
					s[i] = c + 'a';
				}
			}
		}
		cout << s << endl;
	}
	return 0;
}

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

bool isSmallAlphabet(char& ch) {
  /* a ~ z(ascii) : 97 ~ 122 */
  if('a' <= ch && ch <= 'z') return true;
  else return false;
}

bool isHit(string& str) {
  if(str.find("the") != str.npos) return true;
  else if(str.find("this") != str.npos) return true;
  else if(str.find("that") != str.npos) return true;
  else return false;
}

char shiftIndex(char ch) {
  if(isSmallAlphabet(ch)) {
    ch += 1;
    /* ???????????????????°?????????§???????????£??????*/
    if(!isSmallAlphabet(ch)) {
      ch -= 26;
    }
  }
  return ch;
}

/* ????????¶??????????§£??? */
void CaesarCipher(string str) {
  
  /* p??????????????¢??????????????????????????????????????? */
  for(int p = 0; p < 26; ++p) {

    transform(str.begin(), str.end(), str.begin(), shiftIndex);

    /* Find "the" or "this" or "that" */
    if(isHit(str)) {
      cout << str << endl;
    }
  }
}

int main() {
  string str;
  while(getline(cin, str)) {
    CaesarCipher(str);
  }
  return 0;
}