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<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) l = 0; if(z != 3) z = 0;if(zz != 4) zz = 0; }
		}
		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;
}

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

int main(){
	std::string str;
	std::getline(std::cin,str);
	while(true){
		for(int j=0;j<str.size();j++){
			if(str[j]!=' '&&str[j]!='.'){
				int a=static_cast<int>(str[j]);
				a-=2;
				while(a<(int)'a')a+=26;
				while(a>(int)'z')a-=26;
				str[j]=static_cast<char>(a);
			}
		}
		if(str.find("the")!=-1||str.find("this")!=-1||str.find("that")!=-1)break;
	}
	std::cout<<str<<std::endl;
	return 0;
}

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

int main(){
	string s, strCopy;
	while ( getline(cin, s) ) {
		for(int j=0 ; j<26 ; j++){
			for(int i=0 ; i<s.size() ; i++){
				if( s[i] >= 'a' && s[i] <= 'z' ){
					s[i] = ( s[i] == 'z' )? 'a' : s[i] + 1;
				}
			}
			if( s.find( "the" ) != string::npos || s.find( "this" ) != string::npos || s.find( "that" ) != string::npos ){
				cout << s << endl;
			}
		}
	}
	
	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] - '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++: #include <iostream>
#include <string>
using namespace std;
int main()
{
	string str,t;
	while(getline(cin,str))
	{
		for(int i = 1;i < 26;++i)
		{
			t = str;
			for(int j = 0;j < str.size();++j)
			{
				if(t[j] == ' ' || t[j] == '.') continue;
				t[j] = (t[j] - 'a' + i) % 26 + 'a';
			}
			if(t.find("that",0) != string::npos || t.find("this",0) != string::npos || t.find("the",0) != string::npos){
				cout << t << endl;
				break;
			}
		}
	}
	return 0;
}

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

int main(void){
  int len, cnt;
  string str;

  getline( cin, str );

  len = str.length();
  cnt = 0;

  while(true){
    if( str.find("the", 0) != string::npos
	|| str.find("this", 0) != string::npos 
	|| str.find("that", 0) != string::npos
	)
      break;
    for(int i = 0; i < len; i++){
      if( 'a' <= str[i] && str[i] <= 'z' ){
	str[i]++;
	if(str[i] > 'z')
	  str[i] = 'a';
      }
    }

    cnt++;
    if(cnt > 30)
      break;
  }
  
  cout << str;

  return 0;
}

C++: #include <iostream>
#include <string>
#include <math.h>
#include <stdio.h>

using namespace std;

int main() {
    string a;
    
    getline(cin,a);
    
    while (1){
        if(a.find("this")!=-1 || a.find("this")!=-1 || a.find("this")!=-1){
            break;
        }
        
        for(int i=0; i<a.length(); i++){
            if(a[i]==' '|| a[i]=='.'){
                
            }else if(a[i]=='z'){
                a[i]='a';
            }else{
                a[i]++;
            }
        }

    }
    cout<<a<<endl;;
    
    
    return 0;
}

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

int main(){
  string s;
  int cnt=0;

  while(getline(cin, s)){


    while(true){
      bool flag=false;

      for(int i=0;i<s.length();i++){
        string key1 = s.substr(i,3);
        string key2 = s.substr(i,4);
        if(key1 == "the" || key2 == "this" || key2 == "that"){
          flag = true;
          break;
        }
      }

      if(flag){
        cout << s << endl;
        break;
      }

      for(int i=0;i<s.length();i++){
        if(s[i] > 'a' && s[i] < 'z'){
          s[i] -= 'a';
          s[i] -= 1;
          if(s[i] < 0){
            s[i] += 'A' - 'a';
          }
          s[i] += 'a';
        }
      }
    }
  }
}

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

using namespace std;

void CaesarCipher(const string&);
int main(){
  string str;
  while(getline(cin,str)){
    CaesarCipher(str);
  }
}


void CaesarCipher(const string& str){
  string diffstr=str;
  while(diffstr.find("the")==string::npos&&
        diffstr.find("this")==string::npos&&
        diffstr.find("that")==string::npos ){
    for(int i=0;i<str.length();i++){
      diffstr[i]+=isalpha(str[i])?1:0;
    }
  }
}

C++: #include<iostream>
#include<algorithm>
#include<string>
#include<cstdio>
#include<cstring>
using namespace std;
int main(){
  string str;
  char s[256];
  int w = 0;
  while(scanf(" %c",&s[0]) != EOF{
    do {
      w++;
      scanf("%c",&s[w]);
    }while(s[w] != '\n');
    while(1){
      s[w+1] = '\0';
    
      for(int i=0;i<w;i++){
	if(s[i] != ' ' && s[i] != '.'){
	  s[i]++;
	  if(s[i]>'z')s[i] = s[i] - 'z' + 'a' - 1;
	}
      }
      if(strstr(s,"the") != NULL)break;
      if(strstr(s,"that") != NULL)break;
      if(strstr(s,"this") != NULL)break;
    }
    printf("%s",s);
    memset( s , 0 , sizeof(s) );
  }
}

C++: 
using namespace std;
int main(){
  char str;
  while(1){
    str = getchar();
    if(str=='.'){
      cout<<str;
      break;
    }
    if(str!=' '){
      str=str-4;
      cout<<str;
    }else{
      cout<<" ";
    }
  }
  cout<<endl;
  return 0;
}