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<stdio.h>

using namespace std;

int shift(const char* str, int len) {
	char t, h;
	char e, i, a, s;
	int dis;

	for (int pos = 0; pos < len - 1; pos++) {
		if (*(str + 1) == ' ' || *(str + 1) == '.' || *(str + 1) == ',') {
			pos += 2;
			continue;
		}
		t = *(str) - 'a';
		h = *(str + 1) - 'a';
		dis = (t > h) ? (t - h) : (t - h + 26);

		if (dis == 12) {
			e = (h - 3 + 26) % 26;
			i = (h + 1) % 26;
			s = (t - 1 + 26) % 26;
			a = (h - 7 + 26) % 26;

			if ((len > pos + 2 && *(str + pos + 2) == (e + 'a')) ||
				(len > pos + 3 && *(str + pos + 2) == (i + 'a') && *(str + pos + 3) == (s + 'a')) ||
				(len > pos + 3 && *(str + pos + 2) == (a + 'a') && *(str + pos + 3) == (t + 'a'))) {
				return (t - 19 + 26) % 26;
			}
		}
	}
	return -1;
}

int main(int argc, char* argv[])
{
	int s;
	std::string str;

	while (std::getline(cin, str)) {
		s = shift(str.c_str(), str.length());
		if (s == -1) continue;
		for (int i = 0; i < str.length(); i++) {
			printf("%c", (str[i] == ' ' || str[i] == '.' || str[i] == ',') ? str[i] : (char)('a' + ((str[i] - 'a' - s + 26) % 26)));
		}
		printf("\n");
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <sstream>
#include <fstream>

using namespace std;

int main()
{

//	cut here before submit 
//	freopen("testcase.cc", "r", stdin);
	const string key[] = { "the", "this", "that" };

	string str = "";
	
	while (getline (cin, str )){
		int len = str.length();
		int i,j;
		vector <bool> match (3, false);

		for (j = 0; j < 26; ++j){
			string curr = str;
			for (i = 0; i < len; ++i){
				if ( isalpha(str[i]) ){
					curr[i] = (str[i] - 'a' + j) % 26 + 'a';
				} // end if
			} // end for

			for (i = 0; i < 3; ++i){
				if ( curr.find(key[i]) != string::npos ){
					match[i] = true;
				} // end if
			} // end for
//			if ((int)count(match.begin(), match.end(), true ) > 0){
			if ((int)count(match.begin(), match.end(), true ) == sizeof(key)/sizeof(key[0]) ){

				cout << curr << endl;
				break;
			} // end if
		} // end for
	} // end while
		
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include<string>
#include<vector>
int main() {
	std::string s,a;
	std::getline (std::cin , s);
	int p = s[0] - 't';
	for (int i = 0; i < s.size(); ++i) {
		if (s[i] != ' ' &&s[i]!= '.') {
			if (s[i] - p < 'a') {
				a += 'z' - ('a' - (s[i] - p)-1);
			}
			else a += s[i] - p;
		}
		else a += s[i];
	}
	std::cout << a<< std::endl;
	return 0;
}

C++: #include <iostream>
#include <complex>
#include <cmath>
#include <cstdio>
#include <string>
#include <sstream>

using namespace std;

string rotate(string str) {
    for (int i = 0; i < str.size(); i++) {
        if ('a' <= str[i] && str[i] < 'z')str[i]++;
        else if (str[i] == 'z')str[i] = 'a';
    }
    return str;
}

int main() {
    string str;
    while(getline(cin, str)) {
        for (int i = 0; i < 26; i++) {
            str = rotate(str);
            string tmp;
            bool flg = false;
            for (int i = 0; i < str.size(); i++) {
                if (str[i] != '.')tmp += str[i];
            }
            stringstream ss(tmp);
            while(ss >> tmp) {
                if (tmp == "the" || tmp == "this" || tmp == "that")flg = true;
                break;
            }
            if (flg) {
                cout << str << endl;
                break;
            }
        }
    }
    return 0;
}

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

using namespace std;

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

C++: #include <iostream>
#include <string>
using namespace std;
int main()
{
	int i, j;
	string s, res, tmp;
	while (!cin.eof())
	{
		getline(cin, s);
		res = tmp = s;
		for (i = 0; i < 27; i++)
		{
			res = tmp;
			for (j = 0; j < (int)s.size(); j++)
			{
				if (s[j] != ' ' && s[j] != '.')
				{
					if (s[j] + i > 'z')
						res[j] = 'a' + s[j] + i - 'z' - 1;
					else
						res[j] = s[j] + i;
				}
				else
				{
					res[j] = s[j];
				}
			}
			if (res.find("the") != string::npos || res.find("this") != string::npos || res.find("that") != string::npos)
			{
				cout << res << endl;
				break;
			}
		}
	}
}

C++: #include <iostream>
#include <string>
 
using namespace std;
 
int main() { 
  string input_str;
 
  while (getline(cin, input_str)) {
    for (int shift = 0; shift < 26; shift++) {
      for (int str_i = 0; str_i < input_str.size(); str_i++) {
        if (input_str[str_i] >= 'a' && input_str[str_i] < 'z')
          input_str[str_i] ++;
        else if (input_str[str_i] == 'z')
          input_str[str_i] = 'a';
      }
      if (input_str.find("the") != string::npos || input_str.find("this") != string::npos || input_str.find("that") != string::npos)
        break;
    }
    cout << input_str << 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<cstdio>
#include<cstdlib>
using namespace std;
int main(){
  char str;
  while(1){
    str = getchar();
    if(str=='.'){
      cout<<str;
      break;
    }
    if(str!=' '){
      str=str-4;
      cout<<str;
    }else{
      cout<<" ";
    }
  }
  cout<<endl;
  return 0;
}