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 <iostream>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <map>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,b) FOR(i,0,b)
#define PB push_back
#define MP make_pair
char rec(char x,int s){
  return x-s;
}
int main(){
  string s[80];
  int k=0,l=0;
  while(cin>>s[k]){
    int y=s[k][0]-'t';
    if(s[k].size()==3){
      if(rec(s[k][1],y)=='h'&&rec(s[k][2],y)=='e')l=y;
    }
    if(s[k].size()==4){
      if(rec(s[k][1],y)=='h'&&rec(s[k][2],y)=='a'&&rec(s[k][3],y)=='t')l=y;
      else if(rec(s[k][1],y)=='h'&&rec(s[k][2],y)=='i'&&rec(s[k][3],y)=='t')l=y;
    }
    k++;
  }
  for(int i=0;i<k;i++){
    for(int j=0;j<s[i].size();j++){
      if(s[i][j]=='.')cout<<'.';
      else cout<<rec(s[i][j],l);
    }
    if(i==k-1)cout<<endl;
    else cout<<" ";
  }
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<complex>
#include<iomanip>

#define EPS (1e-10)
using namespace std;
#define PI (3.1415926535)

int main(){
	int i;
	bool b = false;
	string str;
	string word[3] = {"the", "this", "that"};

	while(!b && getline(cin, str)){
		for(i = 0; i < 26 && !b; i++){
			for(int j = 0; j < str.size(); j++){
				if(str[j] >= 'a' && str[j] <= 'z'){
					str[j]++;
					if(str[j] > 'z'){
						str[j] -= 26;
					}
				}
			}
			for(int j = 0; j < 3; j++){
				if(str.find(word[j]) != -1){
					b = true;
					break;
				}
			}
		}
	}

	cout << str << endl;

	return 0;
}

C++: #include<stdio.h>
#include<iostream>
#include<math.h>
#include<string>
using namespace std;
int main(){
	
	char s[1000];
	while(cin.getline(s,1000)){
		for(int i=0;s[i]!='\0';i++){
			if(((s[i]-s[i+1]+26)%26=='t'-'h')&&(((s[i+1]-s[i+2]+26)%26==('h'-'e'+26)%26)||(((s[i+1]-s[i+2]+26)%26==('h'-'i'+26)%26)&&((s[i+2]-s[i+3]+26)%26==('i'-'s'+26)%26))||(((s[i+1]-s[i+2]+26)%26==('h'-'a'+26)%26)&&((s[i+2]-s[i+3]+26)%26==('a'-'t'+26)%26)))){
				for(int j=0;s[j]!='\0';j++){
					if((s[j]!=' ')&&(s[j]!='.')&&(s[j]!='\n')){
						putchar((s[j]+'t'-s[i]-'a'+26)%26+'a');
					}else{
						putchar(s[j]);
					}
				}cout<<endl;
				break;
			}
		}
	}
	return 0;
}

C++: #include <iostream>
#include <cmath>
#include <cstdio>
#include <vector>

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

int main(){
    while(getline(cin,s)){
        const char *encrypt = s.c_str();
        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 <stdio.h>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <stdlib.h>
#include <vector>

using namespace std;


int main(){

	vector<string> str, ans;
	string temp;
	int slide;

	while(cin >> temp){
		str.push_back(temp);
	}

	for(int i=0 ; i<str.size() ; i++){
		ans.push_back(str[i]);
	}

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

		for(int j=0 ; j<str.size()-1 ; j++){
			for(int k=0 ; k<str[j].size() ; k++){
				str[j][k]++;
				if(str[j][k] > 'z'){
					str[j][k] = str[j][k] - 'z' + 'a' -1;
				}
			}
		}

		for(int k=0 ; k<str[str.size()-1].size()-1 ; k++){
			str[str.size()-1][k]++;
			if(str[str.size()-1][k] > 'z'){
				str[str.size()-1][k] = str[str.size()-1][k] - 'z' + 'a' -1;
			}
		}
		for(int k=0 ; k<str.size() ; k++){
			if(str[k] == "the" || str[k] == "that" || str[k] == "this"){
				slide = i;
				break;
			}
		}
	}

	for(int i=0 ; i<ans.size()-1 ; i++){
		for(int k=0 ; k<ans[i].size() ; k++){
			if((ans[i][k] + slide) > 'z'){
				ans[i][k] = ans[i][k] - 'z' + 'a' + slide;
			}
		}
		cout << ans[i] << ' ';
	}

	for(int i=0 ; i<ans[ans.size()-1].size() ; i++){
		if((ans[ans.size()-1][i] + slide) > 'z'){
			ans[ans.size()-1][i] = ans[ans.size()-1][i] - 'z' + 'a' +slide;
		}
	}
	cout << ans[ans.size()-1] << endl;

	return 0;
}

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

//メイン関数
int main()
{
  char str[81];
   while(fgets(str,sizeof(str),stdin)!=NULL){
  // while(scanf("%[^/n]s",str)!=EOF){

    //strstrで探索
  if((strstr(str,"the")) || (strstr(str,"this")) || (strstr(str,"that"))){
    puts(str);
    continue;
  }
  int len=strlen(str);
    for(int i=1;i<=26;i++){
      for(int j=0;j<len;j++){
	if(str[j]>='a' && str[j]<='z'){       
	  str[j]++;
	  if(str[j]=='{'){
	    str[j]='a';
	  }
	}
      }
      //strstrで探索
      if((strstr(str,"the")) || (strstr(str,"this")) || (strstr(str,"that")))break;
    }
    printf("%s",str);
  }
}

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

    char a[100];
    while(scanf("%[^\n]",a) != EOF){
        bool flg = 0;
        for(int i = 1; i < 26; i++){
            unsigned char ans[100] = {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] == ' ')flg = 1;
                    if(ans[j+2] == 'i' && ans[j+3] == 's' && ans[j+4] == ' ')flg = 1;
                    if(ans[j+2] == 'a' && ans[j+3] == 't' && 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:;
        fflush(stdin);
    }

    return 0;
}