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<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();
}

C++: #include <bits/stdc++.h>

using namespace std;

void f(string &s)
{
    for (char &c : s) {
        if ('a' <= c && c <= 'z') c = (c - 'a' + 25) % 26 + 'a';
    }
}

int main()
{
    string s;

    while (getline(cin, s)) {
        if (s == "") break;
        while (s.find("the") == string::npos || s.find("this") == string::npos || s.find("that") == string::npos) f(s);
        cout << s << endl;
    }
}

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

using namespace std;

int main()
{
	string s;
	int pl=0;
	while(getline(cin,s))
	{
		if(s=="\n" && s=="EOF") 
			break;

		for(int i =-30;i<30;i++)
		{
			for(int j = 0; j < s.size()-3; j++)
			{
				if(s[j]+i=='t' &&s[j+1]+i == 'h' && s[j+2]+i == 'e')
				{
					pl = i;
					break;
				}

				if(j==s.size()-1) 
					break;

				if(s[j]+i=='t' &&s[j+1]+i == 'h' && s[j+2]+i == 'a' && s[j+3]+i=='t')
				{
					pl = i;
					break;
				}

				if(s[j]+i=='t' &&s[j+1]+i == 'h' && s[j+2]+i == 'i' && s[j+3]+i=='s')
				{
					pl = i;
					break;
				}
			}

			if(pl!=0) 
				break;
		}

		for(int i=0;i <s.size();i++)
		{
			if(s[i]<='z' && s[i]>='a') s[i] += pl;
		}

		cout<<s<<endl;
		pl=0;
	}
}