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

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

bool is_contain_keywords(string str,vector<string>& keywords) {
  int cnt = 0;
  vector<string>::iterator key_itr = keywords.begin();
  while(key_itr != keywords.end()) {
    if(str.find(*key_itr) != string::npos) {
      return true;
    }
    key_itr++;
  }
  return false;
}

string decode(string cipher) {
  vector<string> keywords;
  keywords.push_back("the");
  keywords.push_back("this");
  keywords.push_back("that");

  int remind_shift = -1;
  int max_cnt = 0;
  int str_len = cipher.length();
  for(int shift = 0;shift < 'z' - 'a';shift++) {
    string str = cipher;
    for(int i=0;i<str_len;i++) {
      if('a' < cipher[i] && cipher[i] < 'z') {
        str[i] = (cipher[i] - 'a' + shift) % ('z' - 'a') + 'a';
      }
    }
    if(is_contain_keywords(str,keywords)) return str;
  }
  return "";
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);

  string cipher;
  while(getline(cin,cipher)) {
    cout << decode(cipher) << endl;
  }
}

C++: #include <iostream>
#include<stdio.h>
#include<algorithm>
#include<string.h>
#include<math.h>
#include<stack>
#include<queue>
#include<string>
#include<deque>
#include<set>
#define ll long long
using namespace std;


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