Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

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

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 {
		infos := strings.Split(nextString(), " ")
		plain := make([]string, len(infos))
		if reflect.DeepEqual(infos, []string{}) {
			break
		}
		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 <cctype>
#include <string>
#include <iostream>

using namespace std;

int main()
{
	string S = "";

	getline(cin, S);

	for (int i = 0; i < 26; i++)
	{
		if (!(S.find("this") == S.npos && S.find("that") == S.npos && S.find("the") == S.npos))
		{
			cout << S;
		}

		for (string::size_type i = 0; i < S.size(); i++)
		{
			if (isalpha(static_cast<int>(S[i])))
			{
				if (S[i] == 'z')
				{
					S[i] = 'a';
				}
				else
				{
					S[i]++;
				}
			}
		}
	}

	return 0;
}

C++: #include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b) - 1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)

#define PB push_back
#define INF INT_MAX/3
#define ALL(a) (a).begin(),(a).end()
#define CLR(a) memset(a,0,sizeof(a))

typedef long long int ll;

using namespace std;

int main(){

    string s[] = {"the","this","that"};
    string in;
    while(true){
	getline(cin,in);
	if(cin.eof()) break;
	bool f = false;
	int d = 1;
	REP(i,30){

	    f = true;
	    REP(i,in.size()){
		if(in[i] == '.' || in[i] == ' ' || in[i] == '\n') continue;
		in[i]= (char)( 'a' + ( (int)(in[i] - 'a') + d) % 26);
	    }
	    vector<bool> flgs(3,false);
	    REP(j,3){
		if(in.substr(0,s[j].size()) == s[j] && in[s[j].size() + 1] == ' ') flgs[j] = true;
	    }
	    for(int i=0;i<in.size();i++){
		if(in[i] == ' '){
		    REP(j,3){
			if(in.substr(i+1,s[j].size()) == s[j] && in[i + s[j].size() + 1] == ' ') flgs[j] = true;
		    }
		}
	    }
	    if(flgs[0] || flgs[1] || flgs[2]) break;
	}
	cout << in << endl;
    }

    return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <ctype.h>

using namespace std;

inline char rotate(char c, int x){
    int r = x % 26;
    if(isalpha(c)){
        c -= 'a';
        c += r;
        c += 'a';
    }

    return c;
}

int main(int argc, char const* argv[])
{
    char buf[81];
    int dif;

    while (nullptr != fgets(buf, 81, stdin)) {
        dif = 't' - buf[0];
        for (int i = 0; ; i++) {
            if(buf[i] == '\n'){
                buf[i] = '\0';
                puts(buf);
                break;
            }
            buf[i] = rotate(buf[i], dif);
        }
    }

        return 0;
}

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