Go: package main

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

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 len(infos) == 0 {
			break
		}
		// 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 <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <cmath>
#include <string.h>
using namespace std;

#define FOR(i,s,e) for (int i = int(s); i != int(e); i++)
#define REP(i,e) for (int i = 0; i != int(e); i++)
#define FORIT(i, A) for (auto i : A)
#define ISEQ(c) (c).begin(), (c).end()
#define PRINT(x) cout << (x) << endl
#define SZ(x) ((int)(x).size())

int check(const char* word)
{
	if ((word[1] - word[0]) % 26 != ('h'-'t'))
		return -1;

	if ((word[2] - word[1]) % 26 == ('e'-'h') && 
		(word[3] == ' ' || word[3] == '\0' || word[3] == '\n'))
	{
		return (word[0] - 't' + 26) % 26;
	}
	if ((word[2] - word[1]) % 26 == ('a'-'h') && 
		(word[3] - word[2]) % 26 == ('t'-'a') &&
		(word[4] == ' ' || word[4] == '\0' || word[4] == '\n'))
	{
		return (word[0] - 't' + 26) % 26;
	}
	if ((word[2] - word[1]) % 26 == ('i'-'h') && 
		(word[3] - word[2]) % 26 == ('s'-'i') && 
		(word[4] == ' ' || word[4] == '\0' || word[4] == '\n'))
	{
		return (word[0] - 't' + 26) % 26;
	}
	return -1;
}

int main(int argc, char const *argv[])
{
	string s;
	if (getline(std::cin, s))
	{
		int len = s.length();
		int d = check(&s[0]);
		int i = 3;
		while (d == -1)
		{
			while(i < len && s[i] != ' ')
				i++;
			if (i == len) break;
			i++;
			d = check(&s[i]);
		}
		REP(j, len)
		{
			if (s[j] >= 'a' && s[j] <= 'z')
			{
				s[j] = (s[j] - 'a' - d + 26) % 26 + 'a';
			}
		}
		std::cout << s << std::endl;
	}
	return 0;
}

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

C++: #include <stdio.h>
using namespace std;
int main() {
	string w[3]={"the","this","that"},st;
	int wn[3]={3,4,4},k,i,j,s,f;
	while(true) {
    k=0; 
	getline(cin,st);
	while(k<st.size()) {
		for (i=0;i<3;i++) {
			s=0; f=0;
			if (st.size()<k+wn[i]) break;
			for (j=0;j<wn[i]-1;j++) if ((w[i][j]-w[i][j+1])==(st[k+j]-st[k+j+1])) s++;
			if (s==wn[i]-1)  { f=1; i=5;}
		}
		if (f==1) break;
		for (k;st[k]>='a' && st[k]<='z' && k<80; k++);
		k++;
	}
	if (f==0) cout << st; else {
		for (i=0;i<st.size();i++) 
			if ((st[i]>='a' && st[i]<='z')) cout << (char)(((st[i]-st[k]+'t')-97+26) % 26 + 97) ; 
		    else cout << st[i];
	}
	cout << endl;
	}
	return 0;
	}

C++: #include <stdio.h>
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

string f(const string& s, int k) {
    string t;
    rep (i, s.size()) {
        if (islower(s[i])) t += (char)((s[i]-'a'+k)%26+'a');
        else t += s[i];
    }
    return t;
}

bool ok(const string& t) {
    if (t.find("the") != string::npos) return true;
    if (t.find("this") != string::npos) return true;
    if (t.find("that") != string::npos) return true;
    return false;
}

int main() {
    string s;
    while (getline(cin, s)) {
        if (s.size() > 0 && s[s.size()-1] == '\r') s.resize(s.size()-1);
        rep (i, 26) {
            const string t = f(s, i);
            if (ok(t)) {
                cout << t << endl;
                break;
            }
        }
    }
    return 0;
}

C++: #include <iostream>
#include <cstring>
#include <cstdio>
#include <cctype>
#define N 100
using namespace std;

void hukugou(char str2[]){
  int i;

  while(1){

    for(i = 0;str2[i] != '\0';i++){
      if(str2[i] != ' ' && str2[i] != '\n' && str2[i] != '.'){
	str2[i] = (str2[i] - 'a' + 1) % 26 + 'a';
      }
    }

    if(strstr(str2, "the") != NULL || strstr(str2, "this") != NULL || strstr(str2, "that") != NULL){
      cout << str2;
      break;
    }
  }

}

int main(){
  char str[N];

  fgets(str, sizeof(str), stdin);

  hukugou(str);

  return 0;
}

C++: #define scanf_s scanf
#define gets_s gets
#include <stdio.h>
#include <string>
#include <iostream>
#include <math.h>
using namespace std;
#define MAX 81
#define _MAX 100
#define ABC 26
int main(void)
{
	int n, s = 0, x, y, r = 0, d;
	int sum_n[50][3] = { 0 };
	char str[MAX];
	while (gets_s(str) != NULL) {
		for (int i = 0; str[i] != '\0'; ++i) {
			if (str[i] - 't' == str[i + 1] - 'h') {
				d = str[i] - 't';
				if ((str[i + 2] - 'a' - d + ABC) % ABC == 'e' - 'a') { break; }
				else if ((str[i + 2] - 'a' - d + ABC) % ABC == 'e' - 'a' && (str[i + 2] - 'a' - d + ABC) % ABC == 'e' - 'a') { break; }
				else if ((str[i + 2] - 'a' - d + ABC) % ABC == 'e' - 'a' && (str[i + 2] - 'a' - d + ABC) % ABC == 'e' - 'a') { break; }
			}
		}
		for (int i = 0; str[i] != '\0'; ++i) {
			if ('a' <= str[i] && str[i] <= 'z') {
				printf("%c", (str[i] - 'a' - d + ABC) % ABC + 'a');
			}
			else { printf("%c", str[i]); }
		}
		printf("\n");
	}
}

C++: #include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <cstring>
using namespace std;
typedef long long int ll;
const int INF = 1000000000;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
int main(){
    string s;
    while(getline(cin, s)){
        rep(i, 26){
            for(char& c : s){
                if(isalpha(c)){
                    if(c != 'z') ++c;else c = 'a';
                }
            }
            if(s.find("that") != string::npos || s.find("this") != string::npos || s.find("the") != string::npos){
                cout << s << endl;
            }
        }
    }
    return 0;
}