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 <stdio.h>

int main(void)
{
	char str[80];
	int num, num2;
	int i;
	
	while (fgets(str, 80, stdin) != NULL){
		num = 't' - str[0];
		i = 0;
		while (str[i] != '\0'){
			if (str[i] != '.' && str[i] != ' ' && str[i] != '\n'){
				str[i] += num;
				if (str[i] > 'z'){
					num2 = str[i] - 'z';
					str[i] = num2 + 'a';
				}
				else if (str[i] < 'a'){
					num2 = 'a' - str[i];
					str[i] = 'z' - num2;
				}
			}
			i++;
		}
		printf("%s", str);
	}
	
	printf("\n");
	
	return (0);
}

C++: #include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
#include <string>
#include <functional>
#include <array>
#include <stack>
#include <queue>
#include <chrono>
#include <numeric>
#include <memory.h>
#include <map>
#include <math.h>
#include <utility>
#include <set>

#pragma warning(disable:4996)
using namespace std;
#define REP(i,n) for(int i = 0 ; i < n ; ++i)
typedef long long Int;
const double PI = 3.141592653589793238;
const Int INF = 999999999999;
typedef pair<int, int> P;

vector<string> aa;

int main()
{
	string a;
	while (cin >> a){
		aa.push_back(a);
	}

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

	vector<string> nn;
	vector<string> kk;
	for (auto x : aa){
		auto n = x.length();
		if (n == 3){
			kk.push_back(x);
		}
		if (n == 4){
			nn.push_back(x);
		}
	}

	for (auto x : kk){
		auto n1 = x[0] - c[2][0];
		bool f(true);

		for (int i = 1; i < 3; ++i){
			if (n1 != x[i] - c[2][i])
				f = false;
		}

		if (f){
			int i(0);
			for (auto x : aa){
				for (auto y : x){
					if (y == '.'){
						cout << y;
						continue;
					}

					int q = y - 'a';
					if (q - n1 < 0){
						q = 27 - n1;
					}
					else
						q -= n1;

					cout << (char)(q + 'a');
				}
				if (i < aa.size() - 1)
					cout << " ";
				++i;
			}
			cout << endl;
			return 0;
		}
	}

	for (auto x : nn){
		auto n1 = x[0] - c[0][0];
		auto n2 = x[0] - c[1][0];
		bool f(true);
		bool f2(true);

		for (int i = 1; i < 4; ++i){
			if (n1 != x[i] - c[0][i])
				f = false;
			if (n2 != x[i] - c[1][i])
				f2 = false;
		}

		if (f){
			int i(0);
			for(auto x : aa){
				for (auto y : x){
					if (y == '.'){
						cout << y;
						continue;
					}

					int q = y - 'a';
					if (q - n1 < 0){
						q = 27 - n1;
					}
					else
						q -= n1;

					cout << (char)(q + 'a');
				}
				if (i < aa.size()-1)
					cout << " ";
				++i;
			}
			cout << endl;
			return 0;
		}
		else if (f2){
			int i(0);
			for (auto x : aa){
				for (auto y : x){
					if (y == '.'){
						cout << y;
						continue;
					}

					int q = y - 'a';
					if (q - n2 < 0){
						q = 27 - n2;
					}
					else
						q -= n2;

					cout << (char)(q+'a');
				}
				if (i < aa.size() - 1)
					cout << " ";
				++i;
			}
			cout << endl;
			return 0;
		}

	}

	cout << "emd";
	return 0;
}

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

using namespace std;

int main()
{
    string str;
    getline(cin, str);
    for (int shift = 0;; shift++) {
        bool f = false;
        string s(str);
        for (int pos = 0; pos < s.size(); pos++) {
            char c = s.at(pos);
            if (c >= 'a' && c <= 'z') {
                s[pos] = (char)((((int)c - 'a' + shift) % 26) + 'a'); 
            }
        }
        if (s.find("the") != string::npos || s.find("that") != string::npos || s.find("this") != string::npos) {
                cout << s << endl;
                break;
        }
    }
}

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

int main(){
  char a[100],b[100];
  for(int i;i<100;i++){
    a[i]='\0';
    b[i]='\0';
  }
  gets(a);
  int i=0;
  while(i<26){
    for(int j=0;!(a[j]=='\0');j++){
      if(0x61<=a[j]+i&&a[j]+i<=0x7A)
	b[j]+=i;
      else if(0x61<=a[j]&&a[j]<=0x7A){
	b[j]=a[j]-26+i;
      }
      else if(a[j]==' ')
	b[j]=' ';
      else if(a[j]=='.')
	b[j]='.';
    }
    if(strstr(b,"the")||strstr(b,"this")||strstr(b,"that"))
      break;
    i++;
  }
  for(int k=0;a[k]!='\0';k++)
    cout<<b[k];
  cout<<'\n';
  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;
	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 == 'i' - 'a' && (str[i + 3] - 'a' - d + ABC) % ABC == 's' - 'a') { break; }
				else if ((str[i + 2] - 'a' - d + ABC) % ABC == 'a' - 'a' && (str[i + 3] - 'a' - d + ABC) % ABC == 't' - 'a') { break; }
			}
		}
		for (int i = 0; str[i] != '\0'; ++i) {
			if ('a' <= str[i] && str[i] <= 'z') {
				str[i] = (str[i] - 'a' - d + ABC) % ABC + 'a';
			}
		}
		printf("%s\n", str[i]);
	}
}

C++: #include<cstdio>
#include<iostream>
#include<cstring>
int main(){
    char stl[81];
    char aaaaaataaaaaaaaaari[3][5] = {"this","that","the"};
    int x=0;
    while(1){
        scanf("%c",&stl[x]);
        if(stl[x]==10){
            stl[x] = '\0';
            break;
        }
        x++;
    }
    while(1){
        for(int i=0;;i++){
            if(stl[i]=='\0')
                break;
            if('a'<=stl[i]&&stl[i]<='z')
                stl[i]--;
            if(stl[i]=='a'-1)
                stl[i]='z';

            //printf("%c",stl[i]);

        }//puts("");
        /*for(int i=0;;i++){
            if()
            if(stl[i]=='t'&&stl[i+1]=='h'){
                if(stl[i+2]=='e')
                    goto exit;
                else if(stl[i+2]=='i'&&stl[i+3]=='s')
                    goto exit;
                else if(stl[i+2]=='a'&&stl[i+3]=='t')
                    goto exit;
            }
        }*/
        for(int i=0;i<3;i++)if(strstr(stl,aaaaaataaaaaaaaaari[i])) goto exit;
    }
exit:
    printf("%s\n",stl);
        //a=97
    return 0;
}