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<stdio.h>
#include<string.h>

int main(void){

	char s[81],word[81];
	int i,j;
	int key=0;


	while(gets(s)!=NULL){


		while(1){
		
			i=0;j=0;
			while(s[i] != '\0'){

				if(s[i] == ' '||s[i] == '\n'||s[i+1] == '\0'){


					if(s[i+1] != '\0'){
						i++;
					}
					else if(s[i] != '.'){
						if(s[i]+key <= 'z')
							word[j] = s[i]+key;
						else
							word[j] = 'a'+(key - ('z'-s[i]));
					}


					if(strcmp(word,"the")==0 || strcmp(word,"this")==0 || strcmp(word,"that")==0){
						goto answer;
					}

					for(j=0;j<81;j++)
						word[j] = NULL;
						
					j=0;

					if(s[i+1] == '\0')
						break;

				}
				else{
				
					if(s[i] != '.'){
						if(s[i]+key <= 'z')
							word[j] = s[i]+key;
						else
							word[j] = 'a'+(key - ('z'-s[i]));

						j++;
					}
					i++;
				
				}
			}

			key++;
			if(key > 'z'-'a')
				key = 0;
		}


		answer:
		for(i=0;i<strlen(s);i++){
			if(s[i]>='a' && s[i] <= 'z'){
				if(s[i]+key < 'z')
					putchar(s[i]+key);
				else
					putchar('a'+(key - ('z'-s[i])));
			}
			else
				putchar(s[i]);

		}
		puts("");
		

	}


	return 0;

}

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

int main(){
    string str;
    
    while(getline(cin,str)){
        int flg = 0;
        
        while(true){
            for(int i = 0 ; i < str.length() ; i++){
                string key1 = str.substr(i,3),key2 = str.substr(i,4);
                if(key1 == "the" || key2 == "that" || key2 == "this") flg = 1;
            }
            
            if(flg) goto end;
            else{
                for(int j = 0 ; j < str.length() ; j++){
                    if('a' <= str[j] && str[j] <= 'z'){
                        str[j] -= 'a' - 'A';
                        str[j] = (char)('A'+(str[j]-'A'+26-1)%26);
                        str[j] += 'a' - 'A';
                    }
                    else str[j] = str[j];
                }
            }
        
        
        }
    }
    end:
    cout << str << endl;
    
    return 0;
}

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

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

  getline( cin, buf );
  if( buf[buf.size()-1] == '\n' )
    buf.erase(buf.size()-1);
  if( buf[buf.size()-1] == '\r' )
    buf.erase(buf.size()-1);
  
  str.append(buf);
  str.append(" ");
  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;
  }
  
  str.erase(0,1);
  str.erase(str.size() - 1);
  cout << str << endl;

  return 0;
}

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

int main(int argc, char *argv[]){
  char c[26];
  for (int i = 0; i < 26; i++) {
    c[i] = 'a' + i;
  }
  vector<string> vs;
  string s;
  string ans[] = {"this", "that", "the"};
  vector<string> tmp;
  while(cin >> s)vs.push_back(s);
  vs[vs.size() - 1].pop_back();
  for (int k = 0; k < 26; k++) {
    tmp = vs;
    for (int i = 0; i < vs.size(); i++) {
      for (int j = 0; j < vs[i].length(); j++) {
        tmp[i][j] = c[(vs[i][j] - 'a' + k) % 25];
      }
    }
    for (int i = 0; i < 3; i++) {
      for (int j = 0; j < tmp.size(); j++) {
        if(tmp[j] == ans[i]){k = 50, i = 10, j = 1000;}
      }
    }
  }
  for (int i = 0; i < tmp.size(); i++) {
    std::cout << tmp[i];
    if(i == tmp.size() - 1)std::cout << "." << std::endl;
    else std::cout << " ";
  }
  return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
char a[53]="abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz";
int main(){
    char str[81];
    for(int i=0;i<81;i++)str[i]=0;
    for(int i=0;i<80;i++){
        str[i]=getchar();
        if(str[i]==10)break;
    }
    int len=strlen(str);
    for(int i=0;i<26;i++){
        char cpy[81];
        strncpy(cpy,str,81);

        for(int j=0;j<len;j++){
            if(str[j]==' ' || str[j]=='.')continue;
            cpy[j]=a[cpy[j]-'a'+i];
        }
        bool f=false;
        for(int j=0;j<len-2;j++){
            if(!strncmp(cpy+j,"the",3))f=true;
            if(!strncmp(cpy+j,"this",4))f=true;
            if(!strncmp(cpy+j,"that",4))f=true;
        }
        if(f){
            cout<<cpy<<endl;
            break;
        }
    }
    return 0;


}

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

int search_number(const std::string &s)
{
    for (unsigned i = 0; i < s.size() - 3; ++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')
            return s[i] - 't';
    }
    return 0;
}

int main()
{
    std::string s;
    while (getline(std::cin, s)) {
        int n = search_number(s);
        for (unsigned i = 0; i < s.size(); ++i) {
            if (s[i] != ' ' && s[i] != ',' && s[i] != '.') {
                s[i] -= n;
                if (s[i] < 'a') s[i] += 26;
                if (s[i] > 'z') s[i] -= 26;
            }
        }
        std::cout << s << std::endl;
    }
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <vector>
using namespace std;
int main() {
	string str;
	string w[3] = { "the","this",  "that" };
	while (getline(cin, str)) {
		if (str == "")break;
		while (true) {
			if (str.find("this") == string::npos &&
				str.find("the") == string::npos &&
				str.find("that") == string::npos ) {

				for (char &c : str) {
					if (c != ' ' && c != '.') {
						c = (c - 'a' + 1) % 26 + 'a';
					}
				}

			}
			else {
				break;
			}
		}
		cout << str << endl;
	}
}