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 <cmath>
#include <cstdio>
#include <vector>

using namespace std;
char encrypt[50];
char decrypt[50];
int key,i;

int main(){
    scanf("%[^\r\n]", encrypt);
    while(encrypt[i] != '\0'){
        if(encrypt[i] - encrypt[i+1] == 12){
            key = 't' - encrypt[i];
            break;
        }
        i++;
    }

    i = 0;
    while(encrypt[i] != '\0'){
        if(encrypt[i] <= 'z' && encrypt[i] >= 'a'){
            decrypt[i] = (encrypt[i] - 'a' + key) % 26 + 'a';
        }
        else{
            decrypt[i] = encrypt[i];
        }
        i++;
    }
    printf("%s\n", decrypt);
    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 <bits/stdc++.h>
#define rep(i,a,n) for(int i=a;i<n;i++)
#define repr(i,a,n) for(int i=a;i>=n;i--)
#define INF 999999999
#define INF_M 2147483647
#define pb(a) push_back(a)

using namespace std;
typedef pair<int, int> pii;
typedef long long int ll;
typedef vector<pii> VP;

int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};

int main() {
    string s;
    getline(cin,s);
    string t;
    rep(j,0,26) {
    	t.clear();
    	rep(i,0,s.length()) {
			if('a' <= s[i] && s[i] <= 'z') t += (s[i] + j > 'z') ? (s[i] + j - 26) : (s[i] + j);
			else t += s[i];
    	}
    	if(t.find("this") != string::npos) break;
    	else if(t.find("the") != string::npos) break;
    	else if(t.find("that") != string::npos) break;
    }
    cout << t << endl;
    return 0;
}

C++: #include <cmath>
#include <iostream>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
#include <sstream>

using namespace std;

string decode(string inp,int n){
    string in=inp;
    for(int i=0;i<in.length();i++){
        if('a'<=in[i]&&in[i]<='z'){
            
            in[i]=in[i]-n;
            if(in[i]<'a') in[i]+=('z'-'b');
        }
    }
    return in;
}


int main(){
    string input,decoded;
    while(getline(cin,input)){
        for(int i=0;i<26;i++){
            input=decode(input,1);
            if(input.find("the")!=string::npos||input.find("this")!=string::npos||input.find("that")!=string::npos){
                break;
            }
        }
        cout << input << endl;
    }
    return 0;
}

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


int main()
{
   // freopen("input.txt","r",stdin);
    char str[] = "wxyzabcdefghijklmnopqrstuvwxyz";
    char c;
    while(scanf("%c",&c)!=EOF)
    {
        if(isalpha(c))
            cout << str[(int)c-'a'];
        else
            cout << c;
    }
    return 0;
}

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

using namespace std;

int main(){
	string str;
	while(getline(cin,str)){
		for(int num=0;num<26;num++){
			for(int i=0;i<str.length();i++){
				if(97<=str[i] && str[i]<=122){
					str[i]+=1;
					if(str[i]>122) str[i] -=26;
				}
			}
			string::size_type index1 = str.find("the");
			string::size_type index2 = str.find("this");
			string::size_type index3 = str.find("that");
		
			if( index1 == string::npos && index2 == string::npos &&
				index3 == string::npos){
				continue;
			}else{
				cout << str <<endl;
				break;
			}
		}
	}
	return 0;

}

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

using namespace std;

int main()
{
  string temp,mainstr;
  
  while(getline(cin,mainstr)){
    temp = mainstr;
    vector<string> str;
    int i,j,k,judge=0,gosuu=0;
    
    //入力を単語ごとに分割
    i=0;
    while(1){
      int index;
      index = temp.rfind(" ");
      
      if (index==-1){
	str.push_back(temp.substr(index+1));
	temp = temp.substr(0,temp.size()-str[i].size()-1);
	gosuu++;
	break;
      }else{
	str.push_back(temp.substr(index+1));
	temp = temp.substr(0,temp.size()-str[i].size()-1);
	gosuu++;
	i++;
      } 
    }
    
    //単語からピリオドを取り除く
    for(i=0;i<gosuu;i++){
      if (str[i].find(".")!=-1)
	str[i] = str[i].substr(0,str[i].size()-1);
    }
    
    //単語を変換してチェックしていく
    for(i=0;i<gosuu;i++){
      for(k=1;k<26;k++){
	
	//単語を1個ずらしたものに変換
	for(j=0;j<str[i].size();j++){
	  if (str[i][j] == 'z')
	    str[i][j] = 'a';
	  else
	    str[i][j] += 1;
	}
	
	if ((str[i]=="this")||(str[i]=="that")||(str[i]=="the")){
	  judge = 1;
	  break;
	}
	
      }
      if (judge==1) break;
    }
    
    //文章の変換
    
    for(j=0;j<k;j++){
      for(i=0;i<mainstr.size();i++){
	if ((mainstr[i]!=' ')&&(mainstr[i]!='.')){
	  if (mainstr[i] == 'z')
	    mainstr[i] = 'a';
	  else
	    mainstr[i] += 1;
	}
      }
    }
    //変換した文字の出力
    cout << mainstr <<endl;
    
    /*
    for(i=0;i<str.size();i++){
      cout << str[i] <<endl;
    }*/
    
  }

  return 0;
}