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 <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b) - 1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)

#define PB push_back
#define INF INT_MAX/3
#define ALL(a) (a).begin(),(a).end()
#define CLR(a) memset(a,0,sizeof(a))

typedef long long int ll;

using namespace std;

int main(){

    string s[] = {"the","this","that"};
    string in;
    while(true){
	getline(cin,in);
	if(cin.eof()) break;
	bool f = false;
	int d = 1;
	REP(i,30){

	    f = true;
	    REP(i,in.size()){
		if(in[i] == '.' || in[i] == ' ' || in[i] == '\n') continue;
		in[i]= (char)( 'a' + ( (int)(in[i] - 'a') + d) % 26);
	    }
	    vector<bool> flgs(3,false);
	    REP(j,3){
		if(in.substr(0,s[j].size()) == s[j] && in[s[j].size()] == ' ') flgs[j] = true;
	    }
	    for(int i=0;i<in.size();i++){
		if(in[i] == ' '){
		    REP(j,3){
			if(in.substr(i+1,s[j].size()) == s[j] && in[i + s[j].size() + 1] == ' ') flgs[j] = true;
		    }
		}
	    }
	    if(flgs[0] || flgs[1] || flgs[2]) break;
	}
	cout << in << endl;
    }

    return 0;
}

C++: #include <string>
#include <vector>
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <map>
#define INF 100000000
#define rep(i,a) for(int i=0;i<(a);i++)

using namespace std;
typedef long long ll;

char p(char ch){
    char ret=ch+1;
    if(ret==('{'))ret='a';
    return ret;
}


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


    rep(i,30){
        rep(i,s.size()){
            if(s[i]!=' ' && s[i]!='.'){
                s[i]=p(s[i]);
            }
        }

        if( s.find("the",0)!=-1 || s.find("this",0)!=-1 || s.find("this",0)!=-1 ){
            break;
        }
    }
    cout<<s<<endl;
    
    return 0;
    
}

C++: #include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main(){
  string s;
  int pl=0;
  getline(cin,s);
  for(int i =-27;i<27;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;
      }
      else if(s[j]+i=='t' &&s[j+1]+i == 'h' && s[j+2]+i == 'a' && s[j+3]=='t'){
	pl = i;
	break;
      }
      else if(s[j]+i=='t' &&s[j+1]+i == 'h' && s[j+2]+i == 'i' && s[j+3]=='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;
}

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

using namespace std;

int main() {
    string input;
    const int alph_lim = 26;

    while (getline(cin, input, '\n')) {
        for (int i = 0; i < alph_lim; i++) {
            for (int j = 0; j < input.size(); j++){
                if(islower(input[j])) {
                    input[j]++;
                    if (input[j] > 'z') {
                        input[j] -= alph_lim;
                    }
                }
            }

            if (input.find("this") != string::npos
                || input.find("that") != string::npos
                || input.find("ths") != string::npos) {

                cout << input << endl;
                break;
            }
        }
    }
}

C++: #include <stdio.h>
int main(){
char c;
while(scanf("%c",&c)!=EOF){
if(c-'a'==0)printf("z");
else if(c-'a'>0&&c-'a'<26)printf("%c",c-1);
else printf("%c",c);
}
}

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

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

C++: #include <iostream>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <stdlib.h>

using namespace std;


int main(){
	string line;

	while(getline(cin, line)){
		int flag;

		for(int i=0 ; i<26 ; i++){
			for(int j=0 ; j<line.size() ; j++){
				if(line[j] != ' ' && line[j] != '.'){
					if(line[j] == 'a'){
						line[j] = 'z' ;
					}else{
						line[j]--;
					}
				}
			}

			for(int k=0 ; k<line.size()-2 ; k++){
				if(line[k] == 't' && line[k+1] == 'h'){
					flag = 1;
					break;
				}
			}
			if(flag == 1) break;
		}
		cout << line << endl;
	}
	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 <fstream>
#include <sstream>
#include <iomanip> 
#include <complex> 
#include <string>
#include <vector> 
#include <list>
#include <deque> 
#include <stack> 
#include <queue> 
#include <set>
#include <map>
#include <bitset>
#include <functional>
#include <utility>
#include <algorithm> 
#include <numeric> 
#include <typeinfo> 
#include <cstdio>
#include <cstdlib> 
#include <cstring>
#include <cmath>
#include <climits> 
#include <ctime> 

using namespace std;

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

		}
	}
	return 0;
}