Go: package main

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

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 reflect.DeepEqual(infos, []string{}) {
			break
		}
		fmt.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 <iostream>
#include <string>
#include <algorithm>
#include <math.h>
#include <vector>
#include <set>

using namespace std;
typedef long long LL;
static const double EPS = 1e-9;

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n) 
void decode(vector<string> &words)
{
  int s=0;
  REP(i,words.size()){
    REP(j,26){
      REP(k,words[i].size()){
        if(words[i][k] >= 'a' && words[i][k] <= 'z' )
        words[i].replace(k, 1, 1,
              'a' + ( words[i][k] + 1 - 'a')%26 );
        
        if(words[i] == "the"||words[i] == "this" || words[i] == "that" ||
           words[i] == "the." || words[i] == "this." || words[i] == "that." )
          s = j;
      }
    }
  }
  REP(i,words.size())
    REP(j,words[i].size())
      if(words[i][j] >= 'a' && words[i][j] <= 'z' )
        words[i].replace(j, 1, 1, 'a' + (words[i][j] + s+1 - 'a')%26 );
}

int main(void){  
  vector<string> words;
  string bf;

  while(true){
    if(!(cin >> bf)) break;
    words.push_back(bf);
    if(bf.find('.') != string::npos){
      decode(words);
      cout << words[0];
      FOR(i,1,words.size())
        cout << " " << words[i];
      cout << endl;
      words.clear();
    }
  }
  return 0;
}

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

typedef pair<string, string> P;

P next_word(string sentence) {
  if (sentence.empty()) return make_pair(string(""), string(""));
  if (sentence[0] == ' ' || sentence[0] == '.') {
    return make_pair("", sentence.substr(1));
  } else {
    P recur = next_word(sentence.substr(1));
    return make_pair(sentence[0] + recur.first, recur.second);
  }
}

bool acceptable(string sentence) {
  P p = next_word(sentence);

  while (! p.first.empty() ) {
    if (p.first == "this" || p.first == "the" || p.first == "that")
      return true;

    p = next_word(p.second);
  }
  return false;
}

char slip(char c) {
  if (c < 'a' || 'z' < c) return c;
  
  string alphabet = "abcdefghijklmnopqrstuvwxyza";
  int index = (int)(c - 'a');
  return alphabet[index + 1];
}

char slip(char c, int n) {
  for (int i = 0; i < n; i++)
    c = slip(c);

  return c;
}

string slip(string code, int n) {
  string val;
  for (int i = 0, len = code.length(); i < len; i++)
    val += slip(code[i], n);

  return val;
}

string decode(string code) {
  for (int i = 1; i < 27; i++) {
    string sentence = slip(code, i);
    if (acceptable(sentence))
      return sentence;
  }

  return "";
}

int main() {
  string code;
  while ( getline(cin, code) )
    cout << decode(code) << endl;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
	string b[100];
	int i,j,k,n;
	int s=0;
	while(1){
		i=0;
		s=0;
		while(cin>>b[i]){
			if(b[i][b[i].size()-1]=='.')break;
			i++;
		}
		b[i].erase(b[i].end()-1);
		for(int h=0;h<30;h++){
			for(j=0;j<=i;j++){
				n=b[j].size();
				for(k=0;k<n;k++){
					if(b[j][k]=='a'){
						b[j][k]='z';
					}else{
						b[j][k]--;
					}
				}
			}
			for(j=0;j<=i;j++){
				if(b[j]=="this" || b[j]=="the" || b[j]=="that")s=1;
			}
			if(s==1)break;
		}
		for(j=0;j<=i;j++){
			cout<<b[j];
			if(j!=i)cout<<" ";
		}
		cout<<"."<<endl;
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,maxe=0,co=0;;
    char str[82][82];
    for(int i=0;;i++){
        cin>>str[i];
        n=strlen(str[i]);
        if(str[i][n-1]=='.'){
                maxe=i+1;
                break;
        }
    }
    for(int i=1;;i++){
        for(int j=0;j<maxe;j++){
            if(str[j][0]-i=='t'){
                if(str[j][1]-i=='h'&&str[j][2]-i=='i'&&str[j][3]-i=='s'||str[j][1]-i=='h'&&str[j][2]=='e'||str[j][1]-i=='h'&&str[j][2]-i=='a'&&str[j][3]=='t'){
                    co=i;
                    break;
                }
            }
        }
        if(co!=0)break;
    }
    for(int i=0;i<maxe;i++){
        for(int j=0;str[i][j]!='\0';j++){
                if(str[i][j]!='.')printf("%c",str[i][j]-co);
                else cout<<".";
        }
        if(i!=maxe-1)cout<<" ";
        else cout<<endl;
    }


}

C++: #define scanf_s scanf
#define gets_s gets
#include <stdio.h>
#include <string>
#include <iostream>
#include <math.h>
using namespace std;
#define MAX 81
#define _MAX 100
#define ABC 26
int main(void)
{
	int n, s = 0, x, y, r = 0, d;
	char str[MAX];

	while (gets_s(str) != NULL) {
		for (int i = 0; str[i] != '\0'; ++i) {
			if (str[i] - 't' == str[i + 1] - 'h') {
				d = str[i] - 't';
				if ((str[i + 2] - 'a' - d + ABC) % ABC == 'e' - 'a') { break; }
				else if ((str[i + 2] - 'a' - d + ABC) % ABC == 'i' - 'a' && (str[i + 3] - 'a' - d + ABC) % ABC == 's' - 'a') { break; }
				else if ((str[i + 2] - 'a' - d + ABC) % ABC == 'a' - 'a' && (str[i + 3] - 'a' - d + ABC) % ABC == 't' - 'a') { break; }
			}
		}
		for (int i = 0; str[i] != '\0'; ++i) {
			if ('a' <= str[i] && str[i] <= 'z') {
				printf("%c", (str[i] - 'a' - d + ABC) % ABC + 'a');
			}
			else { printf("%c", str[i]); }
		}
		printf("\n");
	}
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <ctype.h>
#include <algorithm>
using namespace std;

#define loop(i,a,b) for(int i=(a); i<(int)(b); i++)
#define rep(i,b) loop(i,0,b)
#define all(c) (c).begin(), (c).end()
 
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

int main() {
  string s; getline(cin, s);
  int slide = 0;
  rep(i, s.size()-3) {
    if(islower(s[i]) == 0) continue;
    rep(j, 26) {
      string sub;
      rep(k, 4) sub += (s[i+k]-'0'+j+26)%26 + 'a';
      if(sub.substr(0,3) == "the") slide = j;
      else if(sub == "this" || sub == "that") slide = j;
    }
    if(slide != 0) break;
  }
  rep(i, s.size()) {
    if(islower(s[i]) != 0)printf("%c", (s[i]-'0'+slide+26)%26 + 'a');
    else cout << s[i];
  }
  cout << endl;
}