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++: #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;

int main() {
	char s[81] = {};
	while (fgets(s,sizeof(s),stdin)) {
		int start = 0, ofs=0,ofs2,chk=1;
		char buf;
		for (int i = 0; s[i] != '\n'; i++) {
			cout << "start=" << start << endl;
			if (s[i] == ' ' || s[i] == '.') {
				if (i - start == 3) {
					cout << "a\n";
					chk = 1;
					ofs2 = (int)'t' - (int)s[start];
					for (int j = 1; j < 3; j++) {
						buf = s[start + j] + ofs2;
						if (buf > 'z')
							buf -= 26;
						if (buf < 'a')
							buf += 26;
						if (j == 1 && buf != 'h') {
							chk = 0;
							break;
						}
						if (j == 2 && buf != 'e')
							chk = 0;
					}
					if (chk == 1) {
						ofs = ofs2;
						cout << ofs << endl;
						break;
					}
				}
				if (i - start == 4) {
					cout << "b\n";
					chk = 0;
					ofs2 = (int)'t' - (int)s[start];
					for (int j = 1; j < 3; j++) {
						buf = s[start + j] + ofs2;
						if (buf < 'z')
							buf -= 26;
						if (buf > 'a')
							buf += 26;
						if (j == 1 && buf != 'h') {
							chk = 0;
							break;
						}
						if (j == 2 && buf == 'a')
							chk = 2;
						if (j == 2 && buf == 'i')
							chk = 3;
						if (j == 2 && buf != 'i'&&buf != 'i') {
							chk = 0;
							break;
						}
						if (j == 3 && chk == 2) {
							if (buf == 't')
								chk = 1;
							else {
								chk = 0;
								break;
							}
						}
						if (j == 3 && chk == 3) {
							if (buf == 's')
								chk = 1;
							else {
								chk = 0;
								break;
							}
						}
					}
					if (chk == 1) {
						ofs = ofs2;
						cout << ofs << endl;
						break;
					}
				}
				start = i + 1;
			}
		}
		for (int i = 0; s[i] != '\n'; i++) {
			if (s[i] != ' '&& s[i]!='.') {
				s[i] += ofs;
				if (s[i] > 'z')
					s[i] -= 26;
				if (s[i] < 'a')
					s[i] += 26;
			}
		}
		cout << s;
	}
	return 0;
}

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

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

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

	return 0;
}

C++: module main;
import std.stdio;
import std.string;

void main()
{
  string s;
  while((s = chomp(readln())).length)
  {
    char s2[] = new char[s.length];
    for(auto i = 0; i < 26; i++)
    {
      for(auto j = 0; j < s.length; j++)
      {
        s2[j] = s[j];
        if(!(s[j] == ' ' || s[j] == '\n' || s[j] == '.'))
          s2[j] = 'a' + ((s[j] - 'a') + i) % 26;
      }

      if(s2.indexOf("the") != -1 || s2.indexOf("this") != -1 || s2.indexOf("that") != -1)
      {
        writef("%s\n", s2);
        break;
      }
    }
  }
}

C++: #include<stdio.h>
#include<iostream>
#include<math.h>
#include<string>
using namespace std;
int main(){
	
	char s[100];
	while(cin.getline(s,100)){
		for(int i=0;s[i]!='\0';i++){
			if((s[i]-s[i+1]=='t'-'h')&&(((s[i+1]-s[i+2]=='h'-'i')&&(s[i+2]-s[i+3]=='i'-'s'))||(s[i+1]-s[i+2]=='h'-'e')||((s[i+1]-s[i+2]=='h'-'a')&&(s[i+2]-s[i+3]=='a'-'t')))){
				for(int j=0;s[j]!='\0';j++){
					if((s[j]!=' ')&&(s[j]!='.')){
						if(s[j]+'t'-s[i]-'a'<0){
							putchar('z'-'a'+s[j]+'t'-s[i]+1);
						}else{
							putchar(s[j]+'t'-s[i]);
						}
					}else{
						putchar(s[j]);
					}
				}cout<<endl;
				break;
			}
		}
	}
}

C++: #include <stdio.h>
#include <string.h>
int len=0,i=0,j;char RideBack[50][85];
void MORPH() {
	for (j=0;j<=i;j++) {for (int left=0,right=strlen(RideBack[j]);left<right;left++)
		if (RideBack[j][left]>='a' && RideBack[j][left]<='z') {RideBack[j][left]=(RideBack[j][left]-'a'+len)%26+'a';}
	if (j) printf(" ");printf("%s",RideBack[j]);}
}
void blocks() {
	int left,right=strlen(RideBack[i]);for (left=1;left<=26;left++) {
		for (j=0;j<right;j++)
			if (RideBack[i][j]>='a' && RideBack[i][j]<='z') {RideBack[i][j]++;if (RideBack[i][j]>'z') RideBack[i][j]='a';}
		if (RideBack[i][0]=='t' && RideBack[i][1]=='h') {
			if (right==3 && RideBack[i][2]=='e') len=left;
			else if (right==4 && RideBack[i][2]=='i' && RideBack[i][3]=='s') len=left;
			else if (right==4 && RideBack[i][2]=='a' && RideBack[i][3]=='t') len=left;
		}
	}
}
int main() {char T;while (1) {scanf("%s",&RideBack[i]);if (scanf("%c",&T)==EOF) {blocks();MORPH();puts("");return 0;} else if (T=='\n') {blocks();MORPH();puts("");i=0,len=0;} else blocks(),i++;}}

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

bool IncludeKeyWords(const string& Sentence)
{
	if(Sentence.find("the")  <= 80) return true;
	if(Sentence.find("this") <= 80) return true;
	if(Sentence.find("that") <= 80) return true;
	return false;
}

string OneShift(string Sentence)
{
	for(int i = 0; i < Sentence.size(); i++){
		if(97 < Sentence[i] && Sentence[i] < 123){
			Sentence[i] --;
		}else if(Sentence[i] == 97){
			Sentence[i] = 123;
		}
	}
	return Sentence;
}

string Decrypt(string Sentence)
{
	int RoopCount = 0;
	while(IncludeKeyWords(Sentence) == false){
		assert(RoopCount < 26);
		Sentence = OneShift(Sentence);
		RoopCount++;
	}
	return Sentence;
}

int main()
{
	while(true){
		string Sentence;
		getline(cin, Sentence);
		if(cin.eof() == true) break;
		string DecryptedSentence = Decrypt(Sentence);
		cout << DecryptedSentence << endl;
	}
	return 0;
}

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

class MyTransform {
private :
   int shift ;
public :
   MyTransform( int s ) : shift( s ) { }

  char operator( )( char c ) {
      if ( isspace( c ) )
	 return ' ' ;
	 else if(ispunct(c))
              return c;
      else {
	 static std::string letters( "abcdefghijklmnopqrstuvwxyz" ) ;
	 std::string::size_type found = letters.find(tolower( c )) ;
	 int shiftedpos = ( static_cast<int>( found ) + shift ) % 26 ;
	 if ( shiftedpos < 0 ) //in case of decryption possibly
	    shiftedpos = 26 + shiftedpos ;
	 char shifted = letters[shiftedpos] ;
	 return shifted ;
      }
  }
} ;

int main( ) {
        
   std::string input ;
   while(getline( std::cin , input )) {
   int myshift = 4 ;
   myshift *= -1 ; //decrypting again
   std::transform ( input.begin( ) , input.end( ) , input.begin( ) ,
	 MyTransform( myshift ) ) ;
   std::cout << input << std::endl ;
   }
   return 0 ;
}