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 <iostream>
#include <string.h>
#include <sstream>
#include <ctype.h>
using namespace std;

string com[3] = {"the", "this", "that"};

string incAlpha (string str, int k) {
    for (int i = 0; i < str.size(); i++) {
        if(isalpha(str[i])) str[i] = ((str[i] + k - 'a') % 26) + 'a'; 
    }
    return str;
}

bool strsrch(string str1, string str2) {
    for (int i = 0; i < str1.size(); i++) {
        if (str1[i] == str2[0]) {
            bool flag = true;
            if (i + str2.size() > str1.size()) flag = false;
            for (int j = 0; j < str2.size() && flag; j++) {
                if (str1[i + j] != str2[j]) flag = false;
            }
            if (flag) return true;
        }
    }

    return false;
}

bool check (string str) {
    for (int i = 0; i < 3; i++) {
        if (strsrch(str, com[i])) return true;
    }
    return false;
}

int main ()
{
    string str;
    while (getline(cin, str)) {
        for (int i = 0; i <= 26; i++) {
            if (check((incAlpha(str, i)))) {
                cout << (incAlpha(str, i)) << endl;
            }
        }
    }

    return 0;
}

C++: #include<iostream>
#include<cctype>
#include<string>
using namespace std;
bool find(string s){
	return s.find("the",0)!=string::npos
		|| s.find("this",0)!=string::npos
		|| s.find("that",0)!=string::npos;
}
string rotate(string s,int n){
	for(int i=0;i<s.size();i++){
		if(isalpha(s[i]))s[i] = (s[i]-'a'+n)%26+'a';
	}
	return s;
}
int main(){
	string s;
	while(getline(cin,s)){
		for(int i=0;i<26;i++){
			if(find(rotate(s,i))){
				cout<<rotate(s,i)<<endl;
				break;
			}
		}
	}
	return 0;
}

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

int main(){
	string str[30];
	int k = 0;
	int zure;
	bool flag = false;
	char mozi;
	while(getline(cin, str[k])){
		if(flag == true){
			k++;
			continue;
		}
		for(int j = 0; j < 26; j++){
			for(int i = 0; i < str[k].size()-2; i++){
				if(str[k][i] == 't'+j && str[k][i+1] == 'h'+j && str[k][i+2] == 'e'+j){
					zure = j;
					flag = true;
					break;
				}
			}
			if(flag == true){
				k++;
				break;
			}
			for(int i = 0; i < str[k].size()-3; i++){
				if(str[k][i] == 't'+j && str[k][i+1] == 'h'+j && str[k][i+2] == 'i'+j && str[k][i+3] == 's'+j){
					zure = j;
					flag = true;
					break;
				}
			}
			if(flag == true){
				k++;
				break;
			}
			for(int i = 0; i < str[k].size()-3; i++){
				if(str[k][i] == 't'+j && str[k][i+1] == 'h'+j && str[k][i+2] == 'a'+j && str[k][i+3] == 't'+j){
					zure = j;
					flag = true;
					break;
				}
			}
			if(flag == true){
				k++;
				break;
			}
		}
		k++;
	}
	for(int j = 0; j < k; j++){
		for(int i = 0; i < str[j].size(); i++){
			if(str[j][i] >= 'a' && str[j][i] <= 'z'){
				str[j][i] = str[j][i]-zure;
				if(str[j][i] < 'a'){
					str[j][i] = str[j][i]+26;
				}
				cout << str[j][i];
			}
			else{
				cout << str[j][i];
			}
		}
		cout << endl;
	}
}

C++: #include <iostream>
#include <string>
int main(int argc, const char * argv[])
{
    using namespace std;
    string word;
    int i;
    while (cin >> word) {
        for (i = 0; i < word.size(); i++) {
            if (isalpha(word[i])) {
                word[i] -= 4;
            }
        }
        cout << word;
        cout << " ";
    }
    cout << "\n";
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main()
{
    string str;
    while(getline(cin,str)){
            while(1){
                if(str.find("the")!=-1||str.find("that")!=-1||str.find("this")!=-1)break;
                for(int i=0;i<str.size();i++){
                    if(str[i]=='.'||str[i]==' '){}
                    else if(str[i]=='a')str[i]='z';
                    else str[i]--;
                }
            }
            cout<<str<<endl;
    }
    return 0;
}

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

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

	return 0;
}

C++: #include<iostream>
using namespace std;
int main()
{
	string s;
	for(;getline(cin,s);)
	{
		bool f=0;
		for(;!f;)
		{
			for(int i=0;i<s.size();i++)
			{
				if(s[i]>='a'&&s[i]<='z')
				{
					s[i]--;
					if(s[i]<'a')s[i]='z';
				}
			}
			string t[3]={"the","this","that"};
			for(int i=0;!f&&i<3;i++)
			{
				for(int j=0;!f&&j+t[i].size()<s.size();j++)
				{
					if(s.substr(j,t[i].size())==t[i])
					{
						cout<<s<<endl;
						f=1;
					}
				}
			}
		}
	}
}

C++: #include<iostream>
#include<vector>
#include<string>

using namespace std;

char returnc(char c){
  if('a'<=c && c<='z'){
    if(c=='z')return 'a';
    return ++c;
  }
  return c;
}
int main(void){
  string s;
  while(getline(cin,s)){

  vector<string> ss;
  string str;
  s+= " ";
  for(int i = 0 ; i < s.size() ; i ++){
    if(s[i] == ' '){
      ss.push_back(str);
      str="";
    }else{
      str+=s[i];
    }
  }
  bool ok=true;
  string out[] = {"this","that","the"};
  while(ok){
    for(int i = 0 ; i < ss.size(); i ++){
      //cout<<ss[i]<<endl;
      for(int j = 0 ; j < ss[i].size() ; j ++){
	ss[i][j] = returnc(ss[i][j]);
      }
      for(int j = 0 ; j < 3 ; j ++){
	if(ss[i] == out[j])ok=false;
      }
    }
  }
  for(int i = 0 ; i < ss.size()-1 ; i ++){
    cout<<ss[i]<<" ";
  }
  cout<<ss[ss.size() - 1]<<endl;
  }
}

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

int caesar[26][255], x, enkrip[100];
int thiss[] = {'t', 'h', 'i', 's'}, the[] = {'t', 'h', 'e'}, that[] = {'t', 'h', 'a', 't'};
string s;
int main() {
	for(int i = 0; i <= 25; i++) {
		for(char j = 'a'; j <= 'z'; j++) {
			if(j + i > 'z') x = j + i - 26; else x = j + i;
			caesar[i][x] = j;
		}
	}
	while(getline(cin, s)) {
	for(int k = 0; k <= 25; k++) {
		int l = 0, z = 0, zz = 0;
		for(int i = 0, j = s.size(); i != j; i++) {
			if(s[i] <= 'z' && s[i] >= 'a') {
				enkrip[i] = caesar[k][s[i]];
				if(enkrip[i] == thiss[l]) l++;
				if(enkrip[i] == the[z]) z++;
				if(enkrip[i] == that[zz]) zz++;
			} else enkrip[i] = s[i];
		}
		if(l == 4 || z == 3 || zz == 4) {
			for(int i = 0, j = s.size(); i != j; i++) {
				printf("%c", enkrip[i]);
			}
			printf("\n");
			break;
		}
	}}
	return 0;
}