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++: #define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>

using namespace std;

int main()
{
	string str;
	while(getline(cin,str)){
		for(int rot = 0;rot< 'z' - 'a' + 1;rot++){
			string tmp = str;
			for(int i=0; i<str.size(); i++){
				if(tmp[i] == ' ') continue;
				if(tmp[i] == '.') continue;
				tmp[i] = (rot + tmp[i]-'a') % ('z' - 'a' + 1) + 'a';
			}
			//cout << tmp << endl;
			if(tmp.find("the") != string::npos
				|| tmp.find("this") != string::npos
				|| tmp.find("that") != string::npos)
			{
				cout << tmp << endl;
			}
		}
	}
	return 0;
}

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

#define NUM_OF_ALPHABET ('z' - 'a' + 1)

bool isValidResult(const std::string str);
bool decodeStr(const std::string srcStr, std::string& dstStr, int decodeNum);

int main(void)
{
	std::string inputStr;
	std::string outputStr;

	char line[100];
	fgets(line, sizeof(line), stdin);
	inputStr = line;

	for (int i = 0; i < NUM_OF_ALPHABET; i++) {
		if (decodeStr(inputStr, outputStr, i)) {
			std::cout << outputStr;
			break;
		}
		outputStr.clear();
	}
	return 0;
}

bool isValidResult(const std::string str)
{
	if (str.find("the") != std::string::npos || str.find("this") != std::string::npos || str.find("that") != std::string::npos) {
		return true;
	}
	else {
		return false;
	}
}

bool decodeStr(const std::string srcStr, std::string& dstStr, int decodeNum)
{
	for (int i = 0; i < srcStr.size(); i++) {
		if (srcStr.at(i) >= 'a' && srcStr.at(i) <= 'z') {
			unsigned char tmpChar;
			tmpChar = srcStr.at(i) + decodeNum;
			if (tmpChar > 'z') {
				tmpChar -= NUM_OF_ALPHABET;
			}
			dstStr.push_back(tmpChar);
		}
		else {
			dstStr.push_back(srcStr.at(i));
		}
	}
	if (isValidResult(dstStr)) {
		return true;
	}
	else {
		return false;
	}
}

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

using namespace std;

int main(void){
	int i, len;
	string encrypted, tmp, decoded;

	while(getline(cin, encrypted)){
		len = encrypted.size();
	
		while(encrypted.find("this") == string::npos &&
			  encrypted.find("that") == string::npos &&
			  encrypted.find("the")  == string::npos){
			for(i=0;i<len;i++){
				if(encrypted[i] >= 97 && encrypted[i] <=122){ //isAlphabet(encrypted[i]);
					encrypted[i] += 1;
					if(encrypted[i] == 123) encrypted[i] = 97;//z->a
				}
			}
		}
	
		cout << encrypted << endl;
	}
	return 0;
}

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

int main(void){
  string s;
  string a[3] = {"this","the","that"};
  getline(cin,s);
  vector<string> ss;
  string n = "";
  s += " ";
  for(int i = 0  ; i < s.size() ; i ++){
    if(s[i] == ' '){
      ss.push_back(n);
      n = "";
    }else{
      n += s[i];
    }
  }
  bool ans = true;
  for(int i = 0 ; i < ss.size() ; i ++){
      for(int j = 0 ; j < ss[i].size() ; j ++){
	ss[i][j] ++;
      }
      //cout<<ss[i]<<" ";
      for(int j = 0 ; j < 3 ; j ++){
	if(ss[i] == a[j]) ans = false;
	break;
      }
    }
  while(ans){
    for(int i = 0 ; i < ss.size() ; i ++){
      for(int j = 0 ; j < ss[i].size() ; j ++){
	ss[i][j] ++;
      }
      //cout<<ss[i]<<" ";
      for(int j = 0 ; j < 3 ; j ++){
	if(ss[i] == a[j]) ans = false;
	break;
      }
    }
  }
  for(int i = 0 ; i < ss.size() ; i ++){
    cout<<ss[i]<<" "; 
  }
  cout<<endl;
}

C++: #include<iostream>
#include<math.h>
using namespace std;
int main(){
    string s;
    while(getline(cin,s)){
        for(int i=0;i<26;i++){
            for(int j=0;j<s.length();j++)
                if(s[j]>='a'&&s[j]<='z')
                    s[j]='a'+(s[j]-'a'+1)%26;
            for(int j=2;j<s.length();j++){
                if(s[j]=='e'&&s[j-1]=='h'&&s[j-2]=='t')
                    goto next;
                if(j>2)
                    if((s[j]=='s'&&s[j-1]=='i'&&s[j-2]=='h'&&s[j-3]=='t')||(s[j]=='s'&&s[j-1]=='i'&&s[j-2]=='h'&&s[j-3]=='t'))
                        goto next;
            }
        }
    next:cout<<s<<endl;
    }
}

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

int main() {
  string str,s;
  int key,word;
  vector<string> seq;
  char decode[4],ans;
  while(getline(cin,str)) {
    seq.clear();
    stringstream ss;
    ss << str;
    while(ss >> s) {
      seq.push_back(s);
    }
    ss.str("");
    ss.clear(stringstream::goodbit);

    word = seq.size();
    key = 100;

    for(int i=0;i<word;i++) {

	decode[0] = *seq[i].substr(0,1).c_str();
	decode[1] = *seq[i].substr(1,1).c_str();
	decode[2] = *seq[i].substr(2,1).c_str();
	decode[3] = *seq[i].substr(3,1).c_str();

	for(int j=1;j<27;j++) {
	  for(int k=0;k<4;k++) {
	    decode[k] -= 97; //a-z 0-25
	    decode[k] ++;//1-26
	    decode[k] %= 26;//0-25
	    decode[k] += 97;//97-122
	  }
	  if( (decode[0] == 't' && decode[1] == 'h' && decode[2] == 'e') && (seq[i].size() == 3)) {
	    key = j;
	    break;
	  }
	  if( (decode[0] == 't' && decode[1] == 'h' && decode[2] == 'i' && decode[3] == 's') && (seq[i].size() == 4) ) {
	    key = j;
	    break;
	  }
	  if( (decode[0] == 't' && decode[1] == 'h' && decode[2] == 'a' && decode[3] == 't') && (seq[i].size() == 4) ){
	    key = j;
	    break;
	  }
	}
      
      if(key!=100) break;
    }

    for(int i=0;i<word;i++) {
      for(unsigned int j=0;j<seq[i].size();j++) {
	ans = *seq[i].substr(j,1).c_str();
	if(ans <= 'z' && 'a' <= ans){
	  ans -= 97;
	  ans += key;
	  ans %= 26;
	  ans += 97;
	}
	cout << ans;
      }
      if(i==word-1) {
	break;
      }
      cout << " ";
      
    }
    cout << endl;
  }
}

C++: #include <iostream>
#include <vector>
#include <string>
using namespace std;
int main(){
	string s;
	while(getline(cin,s)){
		while(s.find("this")==-1 && s.find("that")==-1 && s.find("the")==-1){
			for(int i=0; i<s.length(); i++){
				if(s[i]>='a' && s[i]<'z')
					s[i]++;
				else if(s[i]=='z')
					s[i]='a';
			}
		}
		cout<<s<<endl;
	}
	return 0;
}

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)) {
        while (s.find("the") == string::npos || s.find("this") == string::npos || s.find("that") == string::npos) f(s);
        cout << s << endl;
    }
}