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 <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <cmath>
#include <cstdio>
#include <istream>
#include <sstream>
#include <iomanip>
#include <iterator>
#include <climits>
using namespace std;

typedef ostringstream OSS;
typedef istringstream ISS;

typedef vector<int> VI;
typedef vector< VI > VVI;

typedef long long LL;

typedef pair<int, int> PII;
typedef vector<PII> VPII;

#define X first
#define Y second

string nextConvert(string s) {
	transform(s.begin(), s.end(), s.begin(), [](char c)->char{
			if (islower(c)) return (c - 'a' + 1) % 26 + 'a';
			else 			return c;
		});
	return s;
}

bool check(string s) {
	vector<string> targets({"the", "this", "that"});

	for (auto &target : targets) {
		if (s.find(target) != string::npos) {
			return true;
		}
	}

	return false;
}

int main(void) {
	string s;

	while (getline(cin, s)) {
		for (int i = 0; i < 26; i++) {
			s = nextConvert(s);
			if (check(s)) {
				cout << s << endl;
				break;
			}
		}
	}

	return 0;
}

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

using namespace std;

void shiftchar(char& ch)
{
	if (isalpha(ch)) {
		if (ch == 'z') {
			ch = 'a';
		} else {
			ch = ch + 1;
		}
	}
}

int main()
{
	string input;
	getline(cin, input);

	string decoded = input;
	for (int i = 0; i < 26; ++i) {
		for_each(decoded.begin(), decoded.end(), shiftchar);
		if (decoded.find("the") != string::npos ||
			decoded.find("this") != string::npos ||
			decoded.find("that") != string::npos) {
			break;
		}
	}

	cout << decoded;
	return 0;
}

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

using namespace std;

bool isPlain(string secret){
    bool find_the,find_that,find_this;
    
    find_the = (secret.find("the") != string::npos);
    find_that = (secret.find("that") != string::npos);
    find_this = (secret.find("this") != string::npos);

    return (find_the || find_that || find_this);
}

string decipher(string secret){
    int gap = 1;
    string plain;
    bool check;
    
    //"the", "that", "this"
    check = isPlain(secret);
    
    if(check){
        plain = secret;
    }
    else {
        while(gap<=26){
            string::iterator it = secret.begin();
            for (; it != secret.end(); it += 1){
                if('a'<=*it & *it <='z')
                    *it = (*it!='z') ? *it + 1 : 'a';
                //cout << *it;
            }
            //cout << endl;
            gap++;
            if(isPlain(secret)) break;
        }
    }
    return secret;
}


int main (int argc, char const* argv[]){
    string secret, plain;
    
    
    //暗号文の取得
    getline(cin,secret);
    while(!secret.empty()){
        
        //暗号解読
        plain = decipher(secret);
        //平文の出力
        cout << plain << endl;
        
        getline(cin,secret);
    }
    
    
    return 0;
}

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

using namespace std;

int main()
{
	string str;
	
	while (getline(cin, str)){
		while (1){
			if(str.find("this") != -1 || str.find("the") != -1 || str.find("that") != -1){
           		break;
        	}
		
			for (int i = 0; i < str.size(); i++){
				if (str[i] != ' ' && str[i] != '.'){
					if (str[i] == 'z') str[i] = 'a';
					else str[i]++;
				}
			}
		
		}
		cout << str << endl;
	}
}

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

using namespace std;


int main(){

  string s, strc;

  while(getline(cin,s)){

    for(int j=0;j<26;j++){
      

      if(s.find("the")!=string::npos ||s.find("this")!=string::npos||s.find("that")!=string::npos ){
	cout << s << endl;
      }
      for(int i=0;i<s.size();i++){//size()ツづ債閉カツ篠堋療アツづ個陳キツつウツづーツ陛板つキ
	
	if(s[i]=='z')s[i]='a';
	else if(s[i]>='a'&&s[i]<='z')s[i]++;
      }

    }

  }
  

  return 0;
}

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

using namespace std;
typedef long long ll;

string change(string s){
    int len=s.size();
    for(int i=0;i<len;i++){
        if(s[i]=='a')s[i]='z';
        if('b'<=s[i] && s[i]<='z')s[i]--;
    }
    return s;
}

bool check(string s){
    int len=s.size();
    string tan="";
    for(int i=0;i<len;i++){
        if('a'<=s[i] && s[i]<='z'){
            tan+=s[i];
        }
        else{
            if(tan=="the" || tan=="this" || tan=="that" )return true;
            tan="";
        }
    }
    return false;
}


int main(){
    string s;
    while(getline(cin,s)){
        for(int i=0;i<26;i++){
            s=change(s);
            if(check(s)){cout<<s<<endl;break;}
        }
    }
    return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<map>
#include<queue>
#include<string>
#include<sstream>
#include<cmath>
#include<numeric>
using namespace std;


int main(){
  string alp = "abcdefghijklmnopqrstuvwxyz";
  string s;
  while( getline(cin, s) ){
    // cerr << s.size() << endl;
    bool f = false;
    int tmp = 0;
    for(int i=0; i<26; i++){

      for(int j=0; j<s.size()-4; j++){
        if( alp[ (s[j]-'a'+i)%26 ] == 't' && alp[ (s[j+1]-'a'+i)%26 ] == 'h' && alp[ (s[j+2]-'a'+i)%26 ] == 'i' && alp[ (s[j+3]-'a'+i)%26 ] == 's' ){
          f = true;
          break;
        }
        if( alp[ (s[j]-'a'+i)%26 ] == 't' && alp[ (s[j+1]-'a'+i)%26 ] == 'h' && alp[ (s[j+2]-'a'+i)%26 ] == 'a' && alp[ (s[j+3]-'a'+i)%26 ] == 't' ){
          f = true;
          break;
        }
        if( alp[ (s[j]-'a'+i)%26 ] == 't' && alp[ (s[j+1]-'a'+i)%26 ] == 'h' && alp[ (s[j+2]-'a'+i)%26 ] == 'e' ){
          f = true;
          break;
        }
        // if( s[j] == ' ' ) cerr << ' ';
        // else cerr << alp[ (s[j]-'a'+i)%26 ];
      }
      // cerr << endl;
      if( f ){
        // cerr << "  " << i << endl;
        tmp = i;
        break;
      }
    }
    // cerr << tmp << endl;

    for(int i=0; i<s.size(); i++){
      if( s[i] == ' ' || s[i] == '.' ) cout << s[i];
      else cout << alp[ (s[i] - 'a' + tmp)%26 ];
    }
    cout << endl;
  }

  return 0;
}








// EOF

C++: char*p;c[99];
main(){
    for(;~scanf("%[^\n] ",p=c);puts(c))
        for(;(*p++=*p>96?*p%96%26+97:*p)||!strstr(p=c,"th"););
}