Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

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 scanner.Scan() {
		infos := strings.Split(scanner.Text(), " ")
		plain := make([]string, len(infos))
		// 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 <string>

using namespace std;

int main()
{
  string stro, str;
  while(getline(cin, stro)){
    for(int i = 1; i < 26; i++){
      str = stro;
      for(int j = 0; j < stro.length(); j++){
	if(str[j] != ' ' && str[j] != '.' && str[j] != '\n')
	  if(str[j] + i > 'z')
	    str[j] += i - 26;
	  else
	    str[j] += i;
      }
      unsigned f_the = str.find("the", 0);
      unsigned f_this = str.find("this", 0);
      unsigned f_that = str.find("that", 0);
      if((f_the != string::npos && f_the == 0 && str[f_the + 3] == ' ') || (f_this != string::npos && f_this == 0 && str[f_this + 4] == ' ') || (f_that != string::npos && f_that == 0 && str[f_that + 4] == ' '))
	cout << str << endl;
      else if((f_the != string::npos && (str[f_the - 1] == ' ' || str[f_the - 1] == '.' || str[f_the - 1] == '\n') && (str[f_the + 3] == ' ' || str[f_the + 3] == '.' || str[f_the + 3] == '\n')) || (f_this != string::npos && (str[f_this - 1] == ' ' || str[f_this - 1] == '.' || str[f_this - 1] == '\n') && (str[f_this + 4] == ' ' || str[f_this + 4] == '.' || str[f_this + 4] == '\n')) || (f_that != string::npos && (str[f_that - 1] == ' ' || str[f_that - 1] == '.' || str[f_that - 1] == '\n') && (str[f_that + 4] == ' ' || str[f_that + 4] == '.' || str[f_that + 4] == '\n')))
	cout << str << endl;	 
    }
  }
}

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

int main() {

  string input;

  while(true) {
  if ( cin.eof() ) break;

  getline( cin, input );

  char c;
  for ( int i = 0; i < 26; i++ ) {

    string ans = "";
    for ( int j = 0; j < input.size(); j++ ) {

      c = input[j];
      if ( c >= 'a' && c <= 'z' ) {
	c = 'a' + ( c - 'a' + i )%26 ;
      }
      ans += c;

    }

    if ( ans.find( "the", 0 ) == string::npos && ans.find( "this", 0 ) == string::npos && ans.find( "that", 0 ) == string::npos ) continue;

    cout << ans << endl;

    break;

  }

  }

  return 0;

}

C++: require("fs").readFileSync("/dev/stdin","utf8").split('\n').map(function(i){for(s=26;s--;)r=i.replace(/[a-z]/g,function(j){return String.fromCharCode((j.charCodeAt(0)-97+s)%26+97)}),r.match(/th(e|is|at)/)?console.log(r):0})

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

using namespace std;

void caesar_decipher(string &s, int d) {
    d %= 26;
    for (char &c: s)
        if (c >= 'a' && c <= 'z') {
            c += d;
            if (c < 'a') {
                c += 26;
            } else if (c > 'z') {
                c -= 26;
            }
        }
}

bool testcase_ends() {
    char buf[128];
    if (fgets(buf, 128, stdin) == NULL)
        return 1;

    string s(buf);

    string keywords[]={"the", "this", "that"};
    auto is_valid=[&](string &s)->bool {
        for (string &kw: keywords)
            if (s.find(kw) != string::npos)
                return true;

        return false;
    };

    for (int i=0; i<26; ++i) {
        if (is_valid(s)) break;

        caesar_decipher(s, 1);
    }

    printf("%s", s.c_str());
    return 0;
}

int main() {
    int solved=0;
    while (!testcase_ends())
        ++solved;

    return !solved;
}

C++: #include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define LOOP(i,x,n) for(int i=x;i<n;i++)
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define MP make_pair
#define FR first
#define SC second
#define int long long
using namespace std;
const int MOD=1000000007;
const int INF=9000000009;

signed main(){
  string s;
  while(getline(cin,s)){
    vector<int> spe;
    REP(i,s.size())if(s[i]==' ')spe.PB(i);
    LOOP(i,1,27){
      string t;
      REP(j,s.size()-1){
        if(s[j]==' ')continue;
        if((s[j]+i)<=122){
          t+=(s[j]+i);
        }else{
          t+=((s[j]+i)-26);
        }
      }
      int f=0;
      REP(j,t.size()){
        if(t.substr(j,3)=="the"||t.substr(j,4)=="that"||t.substr(j,4)=="this"){
          int p=0;
          REP(k,t.size()){
            if(k==spe[p]-p-1){
              cout<<t[k]<<' ';
              p++;
            }else{
              cout<<t[k];
            }
          }
          cout<<'.'<<endl;
          f=1;
          break;
        }
      }
      if(f)break;
    }
  }
  return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
int main(){
	string str;int n=0; bool flag=false;
	getline(cin,str);
	for(int k=0;k<26;k++){
		for(int i=0;i<str.size();i++){
				if(str[i]-'a'<0 || str[i]-'z'>0) continue;
				else if(++str[i]-'z'>0) str[i]-=26;		
		};
		string ptr; string qtr;
		for(int i=0;i<str.size()-4;i++){
		ptr=str.substr(i,4); qtr=str.substr(i,3);
			if(ptr=="this" || ptr=="that" || qtr=="the") flag=true;
			if(flag==true) break;
		};
		if(flag==true) break;
	};
	cout << str << '\n' ;
}

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

string arrs[200];

bool judge4(const string &str) {
	int d1 = str[0] - 't';
	int d2 = str[1] - 'h';
	int d3 = str[2] - 'i';
	int d4 = str[3] - 's';
	int d5 = str[2] - 'a';
	int d6 = str[3] - 't';
	return (d1 == d2 && ((d2 == d3 && d3 == d4) || (d2 == d5 && d3 == d6)));
}

bool judge3(const string &str) {
	int d1 = str[0] - 't';
	int d2 = str[1] - 'h';
	int d3 = str[2] - 'e';
	return (d1 == d2 && d2 == d3);
}

int main() {
	cin.clear();
	int cnt = 0;
	while (!cin.eof()) {
		cin >> arrs[cnt++];
		if (cin.eof()) break;
		char ch = getchar();
		if (ch == '\n') {
			bool isOk = 0;
			int delta = 0;
			for (int i = 0; i < cnt; ++i) {
				if (arrs[i].length() == 4) {
					if (judge4(arrs[i])) {
						isOk = 1;
						delta = arrs[i][0] - 't';
						break;
					}
				}else if (arrs[i].length() == 3) {
					if (judge3(arrs[i])) {
						isOk = 1;
						delta = arrs[i][0] - 't';
						break;
					}
				}
			}
			for (int i = 0; i < cnt; ++i) {
				for (int j = 0; j < arrs[i].length(); ++j) 
					if (arrs[i][j] != '.') arrs[i][j]-= delta;
				cout << arrs[i] << ((i == cnt - 1) ? "\n" : " ");
			}
			cnt = 0;
		}
	}
	return 0;
}

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

int main(){
  int index ,flag=0 ,temp= 'z' - '`' ,cnt=0;
  string s ,key[3]={ "the" ,"this" ,"that" };

  while( true ){
    flag = 0;
    getline( cin ,s );
    if( cin.eof() ){
      break;
    }

    while( true ){
      for( int i=0 ; i<s.length()+1 ; i++ ){ // シーザー暗号を戻す
	if( s[i] != '.' && s[i] != ' ' && s[i] != '\n' ){ //　記号はスルー
	  s[i]++;
	  if( s[i] > 'z' ){ // zからaに飛ばす
	    s[i] = 'a';
	  }
	}
      }

      for( int i=0 ; i<3 ; i++ ){
	index = s.find( key[i] ,0 ); // the ,this ,that を探す
	if( index != string::npos ){ // あった
	  cout << s << endl;
	  flag = 1;
	  break;
	}
      }

      if( flag == 1 ){
	break;
      }
    }
  }
}