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>

using namespace std;

char Shift(int, char);

int main(){
  int i, n;
  string str, _str;
  string The = "the", This = "this", That = "that";
  string::iterator iter1, iter2, iter3;

  while(getline(cin, str)){
    n=1;
    while(1){
      _str = str;
      for(i=0; i<_str.size(); i++)
	_str[i] = Shift(n, _str[i]);

      iter1 = search(_str.begin(), _str.end(), The.begin(), The.end());
      iter2 = search(_str.begin(), _str.end(), This.begin(), This.end());
      iter3 = search(_str.begin(), _str.end(), That.begin(), That.end());

      if(iter1 != _str.end() || iter2 != _str.end() || iter3 != _str.end())
	break;

      n++;
    }

    cout << _str << endl;
  }

  return 0;
}

char Shift(int n, char c){
  int x;
  if(c >= 'a' && c <= 'z'){
    x = c + n;
    if(x > 122) x -= 26;
    c = x;
  }
  return c;
}

C++: 
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <stack>
#include <cctype>
#include <complex>
#include <vector>
#include <algorithm>

using namespace std;


bool solve(){
	string str[1000];
	int num=0;
	int k=0;
	while(cin>>str[k]){
		for(int j=0;j<26;j++){
			string str2 = str[k];
			for(int i=0;i<str2.size();i++){
				int cnt=j;
				while(cnt){
					if(str2[i]=='a'){
						str2[i]='z';
					}else{
						str2[i]--;
					}
					cnt--;
				}
			}
//			if(k==0) cout<< str2<<endl;
			if(str2=="the" || str2=="this" || str2=="that"){
				num = j;
				break;
			}
		}
		k++;
	}
	for(int j=0;j<k;j++){
		for(int i=0;i<str[j].size();i++){
			int cnt = num;
			while(cnt){
				if(str[j][i]=='.'){
				}else if(str[j][i]=='a'){
					str[j][i]='z';
				}else{
					str[j][i]--;
				}
				cnt--;
			}
		}
		cout<<str[j];
		if(j!=k-1){
			cout<<" ";
		}else{
			cout<<endl;
		}
	}
	
	return true;
}

int main(){
	cout.setf(ios::fixed);
	cout.precision(10);
	solve();

	return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <cstring>
#include <functional>

using namespace std;

#define REP(i,a,b) for((i)=(a);(i)<(int)(b);(i)++)
#define rep(i,n) REP(i,0,n)
// BEGIN CUT HERE
#define foreach(itr,c) for(typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
template<class T> inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}
// END CUT HERE

int main(){
  int i, j, c;
  string str;

  while(getline(cin,str)){
    int N = str.size();

    rep(c,26){
      rep(i,N) if(str[i] != '.' && str[i] != ' '){
          str[i]--;
          if(str[i] < 'a') str[i] = 'z';
      }
 
      rep(i,N){
        if(str.find("this") != -1 || str.find("the") != -1 || str.find("that") != -1){
          cout << str << endl;
          return 0;
        }
      }
    }
  }

  return 0;
}

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

using namespace std;

int main(int argc, char *argv[]) {
  string str, copy;
  int shif;
  vector<string> result;
  while (getline(cin, str)) {
    copy = str;
    shif = -1;
    while (true) {
      if (str.find(" this ") != string::npos ||
          str.find(" that ") != string::npos ||
          str.find(" the ") != string::npos)
        break;
      else
        for (string::iterator itr = str.begin();
             itr != str.end();
             itr++)
          if ('a' <= *itr && *itr <= 'z') {
            *itr += shif;
          } else if (*itr != '.' && *itr != ' ' &&
                     *itr != '\n') {
            str = copy;
            shif = 1;
            break;
          }
    }
    result.push_back(str);
  }

  for (int i = 0; i < result.size(); i++)
    cout << result[i] << endl;
  return 0;
}

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

using namespace std;

void forward(string& data)
{
	for(auto& c : data)
	{
		if(c < 'a' || 'z' < c)
			continue;

		c++;
		if('z' < c)
			c -= 26;
	}
}

bool test(const string& data)
{
	if(data.find("the") != string::npos)
		return true;
	if(data.find("this") != string::npos)
		return true;
	if(data.find("that") != string::npos)
		return true;

	return false;
}

int main()
{
	while(!cin.eof())
	{
		char buffer[1024];
		cin.getline(buffer, 1024);
		string line(buffer);

		for(int i = 0; i < 26; i++)
		{
			if(test(line))
				break;
			forward(line);
		}

		cout << line << endl;
	}

	return 0;
}

C++: #include<iostream>
#include<iterator>
#include<sstream>
#include<vector>
#include<cstdio>
const int A_SIZE=26;
using namespace std;
bool is_the(string str){
  if(str.size()!=3){return false;}
  if((str[0]-str[1]+A_SIZE)%A_SIZE!=('t'-'h'+A_SIZE)%A_SIZE){return false;}
  if((str[1]-str[2]+A_SIZE)%A_SIZE!=('h'-'e'+A_SIZE)%A_SIZE){return false;}
  return true;
}
bool is_that(string str){
  if(str.size()!=4){return false;}
  if((str[0]-str[1]+A_SIZE)%A_SIZE!=('t'-'h'+A_SIZE)%A_SIZE){return false;}
  if((str[1]-str[2]+A_SIZE)%A_SIZE!=('h'-'a'+A_SIZE)%A_SIZE){return false;}
  if((str[2]-str[3]+A_SIZE)%A_SIZE!=('a'-'t'+A_SIZE)%A_SIZE){return false;}
  return true;
}
bool is_this(string str){
  if(str.size()!=4){return false;}
  if((str[0]-str[1]+A_SIZE)%A_SIZE!=('t'-'h'+A_SIZE)%A_SIZE){return false;}
  if((str[1]-str[2]+A_SIZE)%A_SIZE!=('h'-'i'+A_SIZE)%A_SIZE){return false;}
  if((str[2]-str[3]+A_SIZE)%A_SIZE!=('i'-'s'+A_SIZE)%A_SIZE){return false;}
  return true;
}
bool is_clue(string str){
  return is_the(str) || is_that(str) || is_this(str);
}

int main(){
  char str[80];
  while(cin.getline(str,80)!=0){
    istringstream iss{str};
    vector<string> strs;
    copy(istream_iterator<string>(iss), istream_iterator<string>(), back_inserter(strs));
    int offset=0;
    for(string a : strs){
      if(is_clue(a)){
	offset = 't'-a[0];
	break;
      }
    }
    for(char c : str){
      if(c=='\0'){putchar('\n');break;}
      if(c<'a'||c>'z'){putchar(c);}
      else if(c+offset>'z'){putchar(c+offset-A_SIZE);}
      else if(c+offset<'a'){putchar(c+offset+A_SIZE);}
      else{putchar(c+offset);}
    }
  }
}