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 <cstdio>
#include <algorithm>
#include <stack>
#include <cmath>
using namespace std;

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define llong long long

int main() {
  char a[80];
  REP(i,80) {
    if((a[i] = getc(stdin)) == EOF) break;
  }
  


  while(1) {
    int q = 0;//1..t, 2..th, 3..the, 4...thi, 5..this, 6..tha, 7..that 
    int j = 0;
    while(a[j] != EOF) {
      if(a[j] == 'z') a[j] = 'a';
      else if(a[j] >= 'a' && a[j] < 'z') a[j]++;
      j++;
    }
    j = 0;
    while(a[j] != EOF) {
      switch(q){
      case 0:
	if(a[j] == 't') q++;
	break;
      case 1:
	if(a[j] == 'h') q++;
	else q = 0;
	break;
      case 2:
	if(a[j] == 'e') q = 3;
	else if(a[j] == 'i') q = 4;
	else if(a[j] == 'a') q = 6;
	else q = 0;
	break;
      case 4:
	if(a[j] == 's') q = 5;
	else q = 0;
	break;
      case 6:
	if(a[j] == 't') q = 7;
	else q = 0;
	break;
      }
      j++;
    }
    if(q == 3 || q == 5 || q == 7) break;
  }
  
  int i = 0;
  while(a[i] != EOF) {
    printf("%c",a[i]);
    i++;
  }
printf("\n");
  return 0;
}