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>

#define SIZE 3

using namespace std;

int main() {
	string str, value[SIZE] = {"the", "this", "that"};
	bool judge;
	while (getline(cin, str)) {
		judge = false;
		for (int i = 0; i < 25; i++) {
			for (int j = 0; j < str.size(); j++) {
				if ('a' <= str[j] && str[j] <= 'y') {
					str[j]++;
				}
				else if (str[j] == 'z') {
					str[j] = 'a';
				}
			}

			for (int j = 0; j < SIZE; j++) {
				if (str.find(value[j]) != str.npos) {
					judge = true;
				}
			}

			if (judge) {
				cout << str << endl;
				break;
			}
		}
	}

	return 0;
}

C++: #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int caesar(char s[]);
bool search(char s[]);

int main(){
	char s[256];
	int i,j=0,n=10;
	while(scanf("%[^\n]",&s)!=EOF){
		while(!search(s)){
			for(i=0;s[i]!='.';i++){
				if(s[i]!=' ') s[i]++;
				if(s[i]>122) s[i]=97;
			}
		}
		printf("%s\n",s);
	}
	return 0;
}

bool search(char s[]){
	char *is,*e,*at;
	char *tmp;
	is="this";e="the";at="that";
	tmp = strchr(s,is[0]);
	if(tmp==NULL) return false;
	while(tmp[0]!=NULL){
		if(!strncmp(tmp,is,4))	return true;
		if(!strncmp(tmp,e,4))	return true;
		if(!strncmp(tmp,at,3))	return true;
		tmp++;
	}
	return false;
}

C++: #include <bits/stdc++.h>
 
using namespace std;
 
#define FOR(i, j, k) for(int i = j; i < k; ++i)
#define rep(i, j) FOR(i, 0, j)
#define repr(i, j) for(int i = j; i >= 0; --i)
#define INF (1 << 30)
#define MOD 1e9 + 7
 
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
 
int main() {
    string s;
    while(getline(cin, s)){
    	rep(i, 26) {
	    	rep(j, s.size()) {
	            if('a' <= s[j] && s[j] <= 'z') s[j] = s[j] + 'a';
	            else if(s[j] == 'z') s[j] = 'a';
	        }
	        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 <string>
using namespace std;

int main(){
  int str;
  string s;
  string tmp;
  getline(cin,s);
  for(int i=0;i<27;i++){
    for(int j=0;j<s.size();j++){
      if(s[j] >= 'a' && s[j] <= 'y') s[j]++;
      else if(s[j] == 'z') s[j]='a';
    }
      if((s.find("this")!=string::npos) || (s.find("that")!=string::npos) || (s.find("the")!=string::npos)) break;
    }
  cout << s << endl;
}

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

int main(){
  string in;
  int g = 0;
  getline(cin , in);
  while(1){
    string t[3] = {"the", "that", "this"};
    for(int j=0; j<3; j++)
      for(int i=0; i<4; i++)
      t[j][i] += g;
    
    if(in.find(t[0]) == string::npos ||
       in.find(t[1]) == string::npos ||
       in.find(t[2]) == string::npos
    ){
      g++; continue;
    } else break;
  }
  for(int i=0; i<in.size(); i++){
    char t = in[i];
    if(t == ' ' || t == '.' || t == ',')
      cout << t;
    else
      cout << (char)(in[i]-g);
  }
  cout << endl;
  return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<string>
#include<sstream>
#include<vector>
using namespace std;
signed main(){
        char s[100];
        while( fgets(s, 100, stdin) != NULL ){
                vector<string> words;
                istringstream stream(s);
                string word;
                while(getline(stream, word, ' ')) words.push_back(word);
                int d;
                for(auto w: words){
                        if(w.length()==3 &&
                                        ((int)w[0] - (int)w[1] == (int)'t' - (int)'h') &&
                                        ((int)w[1] - (int)w[2] == (int)'h' - (int)'e')){
                                d = (int)w[0] -'t';
                                break;
                        }else if(w.length()==4 &&
                                        ((int)w[0] - (int)w[1] == (int)'t' - (int)'h') &&
                                        ((int)w[1] - (int)w[2] == (int)'h' - (int)'i') &&
                                        ((int)w[2] - (int)w[3] == (int)'i' - (int)'s')){
                                d = (int)w[0] -'t';
                                break;
                        }else if(w.length()==4 &&
                                        ((int)w[0] - (int)w[1] == (int)'t' - (int)'h') &&
                                        ((int)w[1] - (int)w[2] == (int)'h' - (int)'a') &&
                                        ((int)w[2] - (int)w[3] == (int)'a' - (int)'t')){
                                d = (int)w[0] -'t';
                                break;
                        }
                }
                for(unsigned int i=0; i<100 && s[i]!=0;i++){
                        char c=s[i];
                        if('a'<=c&&c<='z') printf("%c",(char)(c-d));
                        else printf("%c",c);
                }
        }
        return 0;
}

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

using namespace std;

int main(){
  string s;
  getline(cin,s);
  for(int i=1;i<26;i++){
    string ans;
    for(string::iterator it=s.begin();it!=s.end();it++){      
      if(*it==' '||*it=='.'){
	ans.push_back(*it);
	continue;
      }
      ans.push_back((char)(((int)*it-0x61+i)%26+0x61));
    }
    if(ans.find("the")!=string::npos||ans.find("this")!=string::npos||ans.find("that")!=string::npos){
      cout<<ans<<endl;
      break;
    }
  }
  return 0;
}

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

int main() {
	string sa;
	while (getline(cin, sa), sa != "END OF INPUT") {
		int a = sa.size();
		while (1) {
			for (int i = 0; i < a; i++) {
				if (sa[i] > 96 && sa[i] < 123) {
					sa[i] += 1;
				}
					if (sa[i] == 123){
						sa[i] -= 26;
					}				
			}
			size_t za=sa.find("this"||"that"||"the");
			if (za != string::npos) {
				break;
			}
		}
		cout << sa << endl;
	}
	return 0;
}

C++: 
#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <vector>
#include <map>
#include <utility>
#include <complex>
#include <stack>

using namespace std;

typedef complex<double> P;

int main(){

	string s;
	while(getline(cin,s)){
		for (int i = 0; i < 26; i++)
		{
			for(int j = 0; j < (int)s.size(); j++){
				if('a' <= s[j] && s[j] <= 'z'){
					char c = (s[j] - 'a' + 1) % 26 + 'a';
					s[j] = c;
				}
			}

			if(s.find("the") != string::npos || s.find("this") != string::npos || s.find("that") != string::npos)
				break;
		}

		cout << s << endl;
	}

	return 0;
}