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

}

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

bool find(const std::string &text, const std::string pattern){
	int text_i=0,pattern_i=0;
	while(text_i<text.size()&&pattern_i<pattern.size()){
		if(text[text_i]==pattern[pattern_i]) {
			text_i++;
			pattern_i++;
		}else{
			pattern_i=0;
			text_i=text_i-pattern_i+1;
		}
	}
	return (pattern_i==pattern.size()?true:false);
}


void decode( std::string &coded_data,int diff){
	for(int i=0;i<coded_data.size();i++){
		if(isalpha(coded_data[i])){
			coded_data[i]-=diff;
			if(!isalpha(coded_data[i])) coded_data[i]+=26;
		}
	}
}

int main(void){
	std::string coded_data;
	while(std::getline(std::cin,coded_data)){
		for(int i=0;i<26;i++){
			decode(coded_data,1);
			if(find(coded_data,"the") || find(coded_data,"this")||find(coded_data,"that"))
				std::cout<<coded_data<<std::endl;
		}
	}

	return 0;
}

C++: #include<iostream>
#include<string>
#include<cctype>
using namespace std;
 
int main(void)
{
    string str;
    while( getline(cin, str) )
    {
        int i;
        int s = str.size();
        const string::size_type N = string::npos;
        while( str.find("the")==N && str.find("this")==N && str.find("that")==N )
        {
            for(i = 0; i < s; i++)
            {
                if(isalpha(str[i]))
                {
                    str[i] = (str[i]-'a'+1)%26+'a';
                }
            }
        }
        cout << str << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>

using namespace std;


#define all(c) ((c).begin()), ((c).end())
#define debug(c) cerr << "> " << #c << " = " << (c) << endl;
#define iter(c) __typeof((c).begin())
#define present(c, e) ((c).find((e)) != (c).end())
#define cpresent(c, e) (find(all(c), (e)) != (c).end())
#define tr(i, c) for (iter(c) i = (c).begin(); i != (c).end(); i++)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, a, b) for (int i = (int)(a); i <= (int)(b); i++)

#define mp make_pair
#define fst first
#define snd second
#define pb push_back


const double EPS = 1e-10;


typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef complex<double> P;


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

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

int main() {
	string sa;
	while (getline(cin, sa)&& sa != "END OF INPUT") {
		int a = sa.size();
		while (1) {
			for (int i = 0; i < a; i++) {
				if (sa[i] >='a' && sa[i] <='z') {
					sa[i] += 1;
				}
					if (sa[i]>'z'){
						sa[i] -= 26;
					}				
			}
			size_t za=sa.find(" this "||" that "||" the ");
			if (za != string::npos) {break;}
		}
		cout << sa << endl;
	}
	return 0;
}

C++: #include <stdio.h>
#include <string.h>
#include <ctype.h>

int main(){
    char a[81];
    int size;
    int i,t;
    while(fgets(a,81,stdin)!=NULL){
    size = strlen(a);
    for(t=0;t<26;t++){
        for(i=0;i<size;i++)if(isalpha(a[i]))a[i] = 'a'+(a[i]+1-'a')%26;
        for(i=0;i<size;i++){
            if(a[i]=='t'&&a[i+1]=='h'){
                if(a[i+2]=='e'||(a[i+2]=='i'&&a[i+3]=='s')||(a[i+2]=='a'&&a[i+3]=='t')){
                    printf("%s",a);
                    break;
                }
            }
        }
    }
    }
}