Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func incrementByte(b byte) byte {
	if b >= 97 && b < 122 {
		return b + 1
	} else if b == 122 {
		return 97
	}
	return b
}

func main() {
	scanner.Split(bufio.ScanLines)

	for {
		line := nextString()
		if len(line) == 0 {
			break
		}
		for i := 0; i <= 26; i++ {
			decoded := []byte{}
			for j := 0; j < len(line); j++ {
				decoded = append(decoded, incrementByte(line[j]))
			}
			line = string(decoded)
			if strings.Contains(line, "the") || strings.Contains(line, "this") || strings.Contains(line, "that") {
				fmt.Println(line)
				break
			}
		}
	}
}

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

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

int main(){

	char s[100];
	while (gets(s)){
		
		int diff;
		int flag = false;
		//一番最初に｛the,that,this｝がある場合
		diff = s[0] - 't';
		if ((s[1] - diff) == 'h'){
			//printf("%c\n", s[j+1] - diff);
			if ((s[2] - diff) == 'e'){
				//printf("%c\n", s[j + 2] - diff);
				if (s[3] == ' '){
					flag = true;
				}
			}
			else if ((s[2] - diff) == 'a'){
				//printf("%c\n", s[j + 2] - diff);
				if ((s[3] - diff) == 't'){
					//printf("%c\n", s[j + 3] - diff);
					if (s[4] == ' '){
						flag = true;
					}
				}
			}
			else if ((s[2] - diff) == 'i'){
				//printf("%c\n", s[j + 2] - diff);
				if ((s[3] - diff) == 's'){
					//printf("%c\n", s[j + 3] - diff);
					if (s[4] == ' '){
						flag = true;
					}
				}
			}
		}

		if (!flag){
			//一番以降に｛the,that,this｝がある場合
			for (int j = 1; j < strlen(s); j++){
				if ((s[j]) == ' '){
					diff = s[j + 1] - 't';
					if ((s[j + 1] - diff) == 't'){
						//printf("diff:%d\n", diff);
						if ((s[j + 2] - diff) == 'h'){
							//printf("%c\n", s[j+1] - diff);
							if ((s[j + 3] - diff) == 'e'){
								//printf("%c\n", s[j + 2] - diff);
								if (s[j + 4] == ' '){
									break;
								}
							}
							else if ((s[j + 3] - diff) == 'a'){
								//printf("%c\n", s[j + 2] - diff);
								if ((s[j + 4] - diff) == 't'){
									//printf("%c\n", s[j + 3] - diff);
									if (s[j + 5] == ' '){
										break;
									}
								}
							}
							else if ((s[j + 3] - diff) == 'i'){
								//printf("%c\n", s[j + 2] - diff);
								if ((s[j + 4] - diff) == 's'){
									//printf("%c\n", s[j + 3] - diff);
									if (s[j + 5] == ' '){
										break;
									}
								}
							}

						}
					}
				}
			}
		}
		//printf("diff:%d\n",diff);
		for (int i = 0; i < strlen(s); i++){
			if (s[i] == ' ' || s[i] == '.')continue;
			s[i] -= diff;
		}

		printf("%s\n", s);
	}
	return 0;
}

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

using namespace std;

int main(int argc, const char * argv[])
{
    int shift = 1, i=0;
    string in,out;
    getline(cin,in);
    out = in;
    do {
        for (i=0; i<in.length(); i++) {
            if (in[i]!=' '&&in[i]!='.') {
                out[i] = ((in[i] + shift) % ('z'+1)) + 'a';
            }
        }
        if (out.find("the")!=std::string::npos||out.find("that")!=std::string::npos||out.find("this")!=std::string::npos) {
            break;
        }
        else
            shift += 1;
    } while (shift<=25);
    
    cout<<out<<endl;
    return 0;
}

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

using namespace std;

constexpr unsigned ALPH_NUM = 26;

string shift(const string& line, int n);
bool judge(string& word);

int main()
{
    string line;
    while(getline(cin, line)) {
        bool is_solved = false;
        for (auto i = 0; i < ALPH_NUM && !is_solved; i++) {
            string shifted = shift(line, i);

            stringstream ss(shifted);
            string word;
            while (ss >> word) {
                if (judge(word)) {
                    cout << shifted << endl;
                    is_solved = true;
                    break;
                }
            }
        }
    }

    return 0;
}

string shift(const string& line, int n)
{
    string shifted = line;

    for (auto i = 0; i < line.size(); i++) {
        if (line.at(i) >= 'a' && line.at(i) <= 'z') {
            shifted.at(i) = static_cast<char>('a' + (line.at(i) - 'a' + n) % ('z' - 'a' + 1));
        } else {
            shifted.at(i) = line.at(i);
        }
    }

    return shifted;
}

bool judge(string& word)
{
    if (word.at(word.size() - 1) == '.') {
        word.erase(word.end() - 1);
    }

    return ((word == "the" || word == "this" || word == "that")? true: false);
}

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

using namespace std;

int main()
{
  char s[81];

  while(gets(s) != NULL){

    int len = strlen(s);
    
    if(strstr(s,"this") || strstr(s,"that") || strstr(s,"the")){
      cout << s << endl;
      continue;
    }
    
    for(int i = 0;i < 'z' - 'a';i++){
      for(int j = 0;j < len;j++){
	if(s[j] >= 'a' && s[j] <= 'z'){
	  if(s[j]+1 > 'z'){
	    s[j] = 'a';
	  }
	  else{
	    s[j]++; 
	  }
	}
      }
      if(strstr(s,"this") || strstr(s,"that") || strstr(s,"the")){
	cout << s << endl;
	break;
      }
    }
  }
}