Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

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 scanner.Scan() {
		infos := strings.Split(scanner.Text(), " ")
		plain := make([]string, len(infos))
		// 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>
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<string>
using namespace std;
int main(){
  string word;
  while(getline(cin,word)){
    for(int i=0; i<26; i++){
      string::size_type thisp = word.find("this");
      string::size_type thatp = word.find("that");
      string::size_type thep = word.find("the");
      if(thisp != string::npos || thatp != string::npos || thep != string::npos){cout <<word<<endl;break;}
      for(int j=0; j<word.size(); j++){
	if(word[j]<'z' && word[j]>='a'){word[j]++;}
	else if(word[j] == 'z'){word[j] = 'a';}
      }
    }
  }
  return 0;
}

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" )
          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);
    int c = getchar();
    if(c=='\n'){
      decode(words);
      cout << words[0];
      FOR(i,1,words.size())
        cout << " " << words[i];
      cout << endl;
      words.clear();
    }
  }
  return 0;
}

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


int eq(string s,int x){
  for(int k=0;k<80;k++){
    if(s[k]=='t' && s[k+1]=='h'&&s[k+2]=='a' && s[k+3]=='t'){
      return x;
  } else 
     if(s[k]=='t' && s[k+1]=='h'&&s[k+2]=='i' && s[k+3]=='s'){
       return x;
	} else
      if(s[k]=='t' && s[k+1]=='h'&&s[k+2]=='e'){
	return x;
  }
    
  }
  return 30;
}

int nstr(string st,int n){
  for(int k =0;k <80;k++){
    if(st[k] != ' ' && st[k] != '.'){
      if(st[k]+n > 122){
      st[k] = st[k]+n - 26;
      } else {st[k] = st[k] + n;}
    }
  }
  return eq(st,n);
  

}

int main(){
  int i = 0,count=0;
  string str;
  string tmp;
  for(;i<80;){
    cin >> tmp;
    for(int k=0;k<tmp.size();){
      str[i] = tmp[k];
      k++; i++;
    }
    
    if(tmp[tmp.size()-1] == '.'){
      break;
  }
    str[i] = ' '; i++;
   
  }

  for(int p=0 ;p<=25;p++){
    count = nstr(str,p);
    if(count != 30)
      break;
    count = nstr(str,-p);
    if(count != 30)
      break;
  }
 for(int k = 0;k < i;k++)
    cout << str[k];
    cout << endl;

}

C++: /*AOJ 0017*/

#include<iostream>
#include<string>

using namespace std;

char shiftCaesar(char tmp){
	if(tmp>='a' && tmp<= 'y'){
		return tmp+1;
	}
	else if(tmp == 'z'){
		return 'a';
	}
	else{
		return tmp;
	}
}

int main(){

	char str[90];

	while(cin>>str){

		for(;;){
			for(int i=0;str[i]!='\0';i++){
				str[i] = shiftCaesar(str[i]);
			}
			string tmp = str;


			if( tmp.find("the") != -1 || tmp.find("this") != -1 || 
				tmp.find("that") != -1){
					break;
			}


		}

		cout<<str<<endl;

	}
	return 0;
}

C++: //0017
#include <bits/stdc++.h>
using namespace std;

string str;

int find_str(){
	if(str.find("the",0) != string::npos)
		return 1;

	if(str.find("this",0) != string::npos)
		return 1;

	if(str.find("that",0) != string::npos)
		return 1;

	return 0;
}

int main(){
	int i,j;
	while(getline(cin,str)){
		for(i = 0;i < 26;i++){
			for(j = 0;j < str.size();j++){
			if('a'<=str[j]&&str[j]<='z'){
				if(25<(int)str[j]+1-'a'){
					str[j] = 'a';
				}else{
					str[j] = str[j] + 1;
				}
			}
			}
			if(find_str()){
				cout<<str<<endl;
				break;
			}
		}
	}
	return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>

using namespace std;
typedef long long ll;

int main(){
    int in;
    char S[1000];
    
    for(int i=0;;i++){
        
        in = getchar();
        
        if(in==EOF){
            S[i]='\0';
            break;
        }else{
            S[i]=(char)in;
        }
    }
    
    for(int k=0;k<26;k++){
        
        bool f = false;
        
        for(int i=0;S[i]!='\0';i++){
            if('a'<=S[i] && S[i]<='y'){
                S[i]++;
            }else if(S[i]=='z'){
                S[i]='a';
            }
            
            if(i>=2){
                if(S[i-2]=='t' && S[i-1]=='h' && S[i]=='e')
                    f=true;
            }
            if(i>=3){
                if(S[i-3]=='t' && S[i-2]=='h')
                    if((S[i-1]=='i' && S[i]=='s') || (S[i-1]=='h' && S[i]=='t'))
                    f=true;
            }
        }
        
        if(f) break;
    }
    
    for(int i=0;S[i]!='\0';i++)
        printf("%c",S[i]);
    
    return 0;
}

C++: #include <bits/stdc++.h>
#include <vector>
using namespace std;
string str;	
int a, b, c, d;
int main(){
	while(getline(cin, str)){
		a = str.length();
		for(int i = 0; i < a; i++){
			if(str[i] < 97 || str[i] > 122){
				cout << str[i];
			}
			else {
				b = (int)str[i];
				b = b - 4;
				if(b < 97)
					b = b + 26;
				cout << (char)b;
			}
		}
		cout << endl;
	}
	return 0;
}

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

void coding(){
  string s;
  int cnt=0;

  while(getline(cin, s)){


    while(true){
      bool flag=false;
      
      for(int i=0;i<s.length();i++){
	string key1 = s.substr(i,3);
	string key2 = s.substr(i,4);
	if(key1 == "the" || key2 == "this" || key2 == "that"){
	  flag = true;
	  break;
	}
      }
      
      if(flag){
	cout << s << endl;
	break;
      }
    
      for(int i=0;i<s.length();i++){
	if(s[i] > 'a' && s[i] < 'z'){
	  s[i] -= 'a';
	  s[i] += 1;
	  s[i] = s[i]%('A'-'a');
	  s[i] += 'a';
	}
      }
    }
  }
}


int main(){
  coding();
}