Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	for scanner.Scan() {
		var result string
		line := scanner.Text()
		key := make(map[string]string)

		var i int32
		for ; i < 52; i++ {
			makeKey(key, i)
			result = decode(key, line)

			if strings.Contains(result, "the") {
				break
			} else if strings.Contains(result, "this") {
				break
			} else if strings.Contains(result, "that") {
				break
			}
		}

		fmt.Println(result)
	}
}

func makeKey(key map[string]string, shift int32) {
	for i := 'a'; i <= 'z'; i++ {
		cipher := (i + shift)
		if cipher > 'z' {
			cipher = cipher%'z' + 'a' - 1
		} else if cipher < 'a' {
			cipher = cipher + ('z' - 'a') + 1
		}
		key[string(i)] = string(cipher)
	}
}

func decode(key map[string]string, cipher string) string {
	var result string
	for _, v := range cipher {
		if key[string(v)] != "" {
			result += key[string(v)]
		} else {
			result += string(v)
		}
	}
	return result
}

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

enum eKey{
	ENCYPTION,
	CONJUGATED,
};

void conv( string& s, int i, eKey e ){
	if ( e == CONJUGATED ){
		i = 26 - i;
	}
	for( unsigned j = 0; j < s.size(); ++j ){
		if ( s[ j ] >= 'a' && s[ j ] <= 'z' ){
			s[ j ] = ( s[ j ] - 'a' + i ) % 26 + 'a';
		}
	}
}

int main(){
	string s, sThe, sThis, sThat;
	while ( getline ( cin, s ) ){

		for( int i = 0; i < 26; ++i ){
			sThe = "the";
			sThis = "this";
			sThat = "that";
			conv( sThe, i , ENCYPTION );
			conv( sThis, i , ENCYPTION );
			conv( sThat, i , ENCYPTION );
			if ( s.find( sThe ) != string::npos ||
				 s.find( sThis ) != string::npos ||
				 s.find( sThat ) != string::npos ){
					conv( s, i, CONJUGATED );
					break;
			}
		}
			cout << s << endl;
	}

	return 0;
}

C++: #include <bits/stdc++.h>
#include <vector>
using namespace std;
string str;	
int a, b, c, d;
int main(){
	getline(cin, str);
	a = str.length();
	for(int i = 0; i < a; i++){
		if(str[i] < 97 || str[i] > 122){
			cout << str[i];
		}
		else {
			b = (int)str[i];
			b = b - 4;
			if(b < 97)
				b = b + 26;
			cout << (char)b;
		}
	}
	return 0;
}

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

int main() {
  string str,s,newstr;
  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] == 'i' && decode[3] == 's') {
	    key = j;
	    break;
	  }
	  if(decode[0] == 't' && decode[1] == 'h' && decode[2] == 'a' && decode[3] == 't') {
	    key = j;
	    break;
	  }
	}
      
      if(key!=100) break;
    }

    for(int i=0;i<word;i++) {
      for(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<stdio.h>
#include<iostream>
#include<math.h>
#include<string>
using namespace std;
int main(){
char s[1000];
while(cin.getline(s,1000)){
for(int i=0;s[i]!='\0';i++){
if(((s[i]-s[i+1]+26)%26=='t'-'h')&&(((s[i+1]-s[i+2]+26)%26==('h'-'e'+26)%26)||(((s[i+1]-s[i+2]+26)%26==('h'-'i'+26)%26)&&((s[i+2]-s[i+3]+26)%26==('i'-'s'+26)%26))||(((s[i+1]-s[i+2]+26)%26==('h'-'a'+26)%26)&&((s[i+2]-s[i+3]+26)%26==('a'-'t'+26)%26)))){
for(int j=0;s[j]!='\0';j++){
if((s[j]!=' ')&&(s[j]!='.')&&(s[j]!='\n')){
putchar((s[j]+'t'-s[i]-'a'+26)%26+'a');
}else{
putchar(s[j]);
}
}cout<<endl;
break;
}
}
}
return 0;
}

C++: #include<iostream>
using namespace std;
int main()
{
	char key[80] = "";
	
	cin.getline(key, sizeof(key);

		for (int i = 0; i < sizeof(key); i++)
		{
			//if (key[i] == (int)" ")cout << "space";
			if ((int)key[i] == 0)break;
			if ((int)key[i] <= 122 && (int)key[i] >= 97)
				key[i] = (int)key[i] - 1;
			if (key[i] == 96)key[i] = 122;
		}
		for (int i = 0; i < sizeof(key); i++)
		{
			if ((int)key[i] == 0)break;
			cout << key[i];
		}
	
	return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

inline char shift(char c, int i) {
  return char(((c + i) - 'a') % 26 + 'a');
}

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

  int n;
  for (int i = 0; i < 26; ++i) {
    string target;
    for (char c : str) {
      if ('a' <= c && c <= 'z')
        target += shift(c, i);
      else
        target += c;
    }
    for (string key : {"the", "this", "that"}) {
      size_t pos = target.find(key);
      if (pos != string::npos) {
          n = i;
          str = target;
          goto found;
      }
    }
  }

  found:
    cout << str << endl;
}

C++: #include <cmath>
#include <iostream>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
#include <sstream>

using namespace std;


bool check(string inp){
    stringstream words(inp);
    string word;
    while(getline(words, word, ' ')){
        if(word=="the"||word=="this"||word=="that"||word=="the."||word=="this."||word=="that.")
            return true;
    }
    return false;
}

int main(){
    string input;
    while(getline(cin,input)){
        for(int i=0;i<26;i++){
            for(int j=0;j<input.length();j++){
                if(isalpha(input[j])){
                    input[j]++;
                    if(input[j]>'z') input[j]='a';
                }
            }
            if(check(input)){
                break;
            }
        }
        cout << input << endl;
    }
    return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<complex>
#include<iomanip>

#define EPS (1e-10)
using namespace std;
#define PI (3.1415926535)

int main(){
	int i;
	bool b;
	string str;
	string word[3] = {"the", "this", "that"};

	while(getline(cin, str)){
		b = false;
		for(i = 0; i < 26 && !b; i++){
			for(int j = 0; j < str.size(); j++){
				if(str[j] >= 'a' && str[j] <= 'z'){
					str[j]++;
					if(str[j] > 'z'){
						str[j] -= 26;
					}
				}
			}
			for(int j = 0; j < 3; j++){
				if(str.find(word[j]) != -1){
					b = true;
					break;
				}
			}
		}
		cout << str << endl;
	}


	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
using namespace std;
string a,b;
char c[81];
int flg;
int main(){
    getline(cin,a);
    for(;;){
        if(flg==1)break;
        for(int i=0;i<26;i++){
            for(int j=0;j<a.size();j++){
                if(a[j]>='a'&&a[j]<='z'){
                    if(a[j]-1>='a'){
                        a[j]-=1;
                    }else{
                        a[j]+=25;
                    }
                }
            }
            for(int j=0;j<a.size()-3;j++){
                b=a.substr(j,3);
                if(b=="the")flg=1;
                b=a.substr(j,4);
                if(b=="that"||b=="this")flg=1;
                if(flg==1)break;
            }
            if(flg==1)break;
        }
    }
    cout<<a<<endl;
return 0;
}