Go: package main

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

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 reflect.DeepEqual(infos, []string{}) {
			break
		}
		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<iostream>
#include<string>
using namespace std;

int main(){

	string code;
	string word;
	bool found;

	while( getline(cin, code) ){
		found = false;

		for( int j=0;j<25;j++ ){


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


			word = "";
			for( int i=0;i<code.length()+1;i++){
				if(code[i] >= 'a' && code[i] <= 'z' )
					word += code[i];
				else{
					if( word == "the" || word == "this" || word == "that" ){
						found = true;
					}
					word = "";
				}
				
			}
			if(found)break;
			
			
		
		}
		cout << code << endl;

	}
	return 0;

}

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

bool howMuchWords(string s, string key){
  string::size_type index = s.find(key);
  if(index == string::npos){
    return false;
  }else{
    //???????????£???.
    return true;
  }
}
    

int main(){
  string s;
  getline(cin ,s);
  int cnt=0;
  
  
  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(howMuchWords(s, "that") || howMuchWords(s, "this") || howMuchWords(s, "the")){
      // cout << cnt << ": ";
      // cout << s << endl;
      // break;
      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 <fstream>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <iterator>
#include <stack>
typedef long long int lli;
using namespace std;

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

C++: #include <bits/stdc++.h>
using namespace std;

string decrypt(string str1, int move) {
	string str2 = str1;
	for (int i = 0; i < str1.length(); i++) {
		if (str1[i] >= 'a' && str1[i] <= 'z') {
			str2[i] = (str1[i] - 'a' + move) % 26 + 'a';
		}
	}
	return str2;
}

int main(void) {
	string str1, str2;
	while (getline(cin, str1)) {
		for (int i = 0; i < 26; i++) {
			str2 = decrypt(str1, i);
			if (str2.find("this") != string::npos || 
				str2.find("that") != string::npos ||
				str2.find("the") != string::npos)
				break;
		}
		cout << str2 << endl;
	}
}

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

char buf[99];

int main(){
    int i;

    for(;~scanf("%[^\n] ",buf);){
        for(i=0; i<100; i++){
            if( buf[i]-buf[i+1] == 12 ){
                break;
            }
        }
        int sa = buf[i] - 't';
        for(i=0; buf[i]!='\0'; i++){
            buf[i]=!putchar( buf[i] - (97>buf[i] ? 0: sa) );
        }
        puts("");
    }
    return 0;
}

C++: #include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
int main(){

    char a[1000];
    while(scanf("%[^\n]",a) != EOF){
        getchar();
        bool flg = 0;
        for(int i = 1; i < 26; i++){
            unsigned char ans[1000] = {0};
            for(int j = 0; j < strlen(a); j++){
                if(a[j] == ' ' || a[j] == '.') ans[j] = a[j];
                else ans[j] = a[j] + i;
                if(ans[j] > 'z') ans[j] -= 26;
            }
            for(int j = 0; j < strlen(a); j++){
                if(ans[j] == 't' && ans[j+1] == 'h'){
                    if(ans[j+2] == 'e' && ans[j+3] == ' ' || ans[j+3] == 0 || ans[j+3] == '.')flg = 1;
                    if(ans[j+2] == 'i' && ans[j+3] == 's' && ans[j+4] == ' ' || ans[j+4] == 0 || ans[j+4] == '.')flg = 1;
                    if(ans[j+2] == 'a' && ans[j+3] == 't' && ans[j+4] == ' ' || ans[j+4] == 0 || ans[j+4] == '.')flg = 1;
                }
                if(flg){
                    if(j == 0){
                        cout << ans << endl;
                        goto end;
                    }
                    else{
                        if(ans[j-1] == ' '){
                            cout << ans << endl;
                            goto end;
                        }
                    }
                }
            }
        }
        end:;
        for(int i = 0;i < 1000; i++) a[i] = 0;
    }

    return 0;
}

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

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

C++: #include<string>
#include<iostream>
#include<algorithm>
using namespace std;
string henkan(string a)
{
	for (int i = 0; i < a.size(); i++)
	{
		if (a[i] != ' '&&a[i] != '.')
		{
			if (a[i] == 'z')a[i] = 'a';
			else 
				a[i] += 1;
		}
	}
	return a;
}
bool check(string a)
{
	string x[3] = { "the", "this", "that" };
	for (int i = 0; i < 3; i++)
	{
		if (a.find(x[i], 0) != string::npos)return false;
	}
	return true;
}
int main()
{
	
	string a, b;
	cin >> b;
	a.append(b);
	while (cin>>b)
	{
		a.append(" ");

		cin >> b;
		a.append(b);
	}
	while (check(a))
	{
		a = henkan(a);
	}
	cout << a << endl;
	
}

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

using namespace std;

int main()
{
    string s;

    while (getline(cin, s)) {
        while (s.find("the") == s.npos &&
                    s.find("this") == s.npos &&
                    s.find("that") == s.npos) {
            for (int i = 0; i < s.size(); i++) {
                if ('a' <= s[i] && s[i] <= 'y') {
                    s[i]++;
                } else if (s[i] == 'z') {
                    s[i] = 'a';
                }
            }
        }
        cout << s << endl;
    }

    return 0;
}