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 <stdio.h>
#include <string.h>

static char *words[] = {
  "the",
  "this",
  "that"
};

int main(void)
{
  char cipher[80];
  while(scanf("%[^\n]%*c", cipher) != EOF){

    int i,j,k,l;
    for(i=0; i<26; ++i){

      for(j=0; j<strlen(cipher); ++j){
        if('a'<=cipher[j] && cipher[j]<='z'){
          cipher[j] = (cipher[j]-'a'+1)%26+'a';
        }
      }
      
      int hit = 0;
      for(j=0; !hit && j<(sizeof words/sizeof words[0]); ++j){
        for(k=0; !hit && k+strlen(words[j])<=strlen(cipher); ++k){
          for(l=0; l<strlen(words[j]); ++l){
            if(cipher[k+l]==words[j][l]){
              hit = 1;
            }else{
              hit = 0;
              break;
            }
          }
        }
      }

      if(hit){
        printf("%s\n", cipher);
        break;
      }
    }
  }

  return 0;
}

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

vector<string> v;

vector<string> split(string&& s, regex&& pattern) {
    sregex_token_iterator first(s.begin(), s.end(), pattern, -1);
    sregex_token_iterator last;
    return(vector<string>(first, last));
}

bool cheser() {
    for(int r = 1; r <= 50; r++) {
        bool found = false;
        for(int c = 0; c < v.size(); c++) {
            for(int k = 0; k < v[c].length(); k++) {
                if(!isalpha(v[c][k])) continue;
                int now = v[c][k] - 'a';
                now = (now+1)%26;
                v[c][k] = 'a' + now;
            }
            if(v[c] == "the" || v[c] == "this" || v[c] == "that") found = true;
        }
        if(found) return(true);
    }
    return(false);
}

int main(void) {
    string input;
    while(getline(cin, input)) {
        v = split(move(input), regex(" "));
        cheser();
        for(int r = 0; r < v.size(); r++) {
            cout << v[r];
            if(r == v.size() - 1) cout << endl;
            else                  cout << " ";
        }
    }
    
    return(0);
}

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

using namespace std;

void Shift(string *str, int shift, int vec) {
  for (int str_i = 0; str_i < str->size(); str_i++)
    if (!isspace((*str)[str_i]) && (*str)[str_i] != '.')
      (*str)[str_i] += vec * shift;
}

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

int main() { 
  string input_str;

  int shift = 1;
  while (getline(cin, input_str)) {
    while (1) {
      Shift(&input_str, shift, 1);
      if (FindTarget(input_str))
        break;
      Shift(&input_str, shift, -1);
      Shift(&input_str, shift, -1);
      if (FindTarget(input_str))
        break;
      Shift(&input_str, shift, 1);
      shift++;
    }
    cout << input_str << endl;
  }

  return 0;
}

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

using namespace std;

int main()
{
  string stro, str;
  while(getline(cin, stro)){
    for(int i = 1; i < 26; i++){
      str = stro;
      for(int j = 0; j < stro.length(); j++){
	if(str[j] != ' ' && str[j] != '.' && str[j] != '\n')
	  if(str[j] + i > 'z')
	    str[j] += i - 26;
	  else
	    str[j] += i;
      }
      if((str.find("the ", 0) != string::npos && str[0] == 't') || (str.find("this ", 0) != string::npos && str[0] == 't') || (str.find("that ", 0) != string::npos && str[0] == 't') || str.find(" the.", 0) != string::npos || str.find(" this.", 0) != string::npos || str.find(" that.", 0) != string::npos || str.find(" the ", 0) != string::npos || str.find(" this ", 0) != string::npos || str.find(" that ", 0) != string::npos || str.find("\nthe ", 0) != string::npos || str.find("\nthis ", 0) != string::npos || str.find("\nthat ", 0) != string::npos || str.find(" the\n", 0) != string::npos || str.find(" this\n", 0) != string::npos || str.find(" that\n", 0) != string::npos)
      cout << str << endl;	
    }
  }
}