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 <cstring>
using namespace std;

int main(){
	string str;
	int zure;
	bool flag = false;
	char mozi;
	while(getline(cin, str)){
		for(int j = 0; j < 26; j++){
			for(int i = 0; i < str.size()-2; i++){
				if(str[i] == 't'+j && str[i+1] == 'h'+j && str[i+2] == 'e'+j){
					zure = j;
					flag = true;
					break;
				}
			}
			if(flag == true){
				break;
			}
			for(int i = 0; i < str.size()-3; i++){
				if(str[i] == 't'+j && str[i+1] == 'h'+j && str[i+2] == 'i'+j && str[i+3] == 's'+j){
					zure = j;
					flag = true;
					break;
				}
			}
			if(flag == true){
				break;
			}
			for(int i = 0; i < str.size()-3; i++){
				if(str[i] == 't'+j && str[i+1] == 'h'+j && str[i+2] == 'a'+j && str[i+3] == 't'+j){
					zure = j;
					flag = true;
					break;
				}
			}
			if(flag == true){
				break;
			}
		}
		for(int i = 0; i < str.size(); i++){
			if(str[i] >= 'a' && str[i] <= 'z'){
				str[i] = str[i]-zure;
				cout << str[i];
			}
			else{
				cout << str[i];
			}
		}
		cout << endl;
	}
}

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

#define PI (3.141592)

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

	return 0;
}

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

int main(int argc, char *argv[]){
	string s;
    while(getline(cin,s)){
		while(s.find("that") ==string::npos 
			  && s.find("the") ==string::npos
			  && s.find("this") ==string::npos  ){
			for (int i = 0; i < s.length(); ++i){
				if(s[i]<'z' && s[i] >='a') s[i]++;
				if(s[i]=='z') s[i]='a';
			}
		}
		cout<<s<<endl;
	}
    return 0;
}

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

int main(){
	string h[3] = {"the","that","this"};
	string s;
	getline(cin,s);
	int c = 0;
	for(int j=0;j<ALF;j++){
		for(int m=0;m<3;m++){
			for(int k=0;k<=s.size()-h[m].size();k++){
				string t = s.substr(k,h[m].size());
				for(int l=0;l<h[m].size();l++) t[l] = (t[l]-'a'+j)%ALF + 'a';
				if(t==h[m]) c = j;
				cout << c << " " << t << " " << h[m] << endl;
			}
		}
	}
	for(int j=0;j<s.size();j++){
		if('a'<=s[j] and s[j]<='z') s[j] = (s[j]-'a'+c)%ALF + 'a';
	}
	cout << s << endl;
}

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

int main(){
  string s;
  int cnt=0;

  while(getline(cin, s)){


    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(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<cstdio>
#include<cstring>
using namespace std;
char a[53]="abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz";
int main(){
    char str[82];
    for(int i=0;i<82;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[82];
        strncpy(cpy,str,82);

        for(int j=0;j<len;j++){
            if(str[j]==' ' || str[j]=='.' || str[j]==10)continue;
            cpy[j]=a[cpy[j]-'a'+i];
        }
        bool f=false;
        for(int j=0;j<len-3;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>
using namespace std;
int main(){
      string s;
      while(getline(cin,s)){
            for(int i=0;i<25;i++)while(s.find("the")==-1&&s.find("this")==-1&&s.find("that")==-1)for(int j=0;j<s.size();j++)if(s[j]>='a'&&s[j]<='z')s[j]!='z'?s[j]++:s[j]='a';
            cout<<s<<endl;
      }
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#define INF 1000000000

using namespace std;

// the this that

vector<string> split(string str, string delim) {
  vector<string> res;
  int cutAt;
  while ((cutAt = str.find_first_of(delim))!=str.npos) {
    if (cutAt > 0) {
      res.push_back(str.substr(0,cutAt));
    }
    str = str.substr(cutAt+1);
    if (str.length() > 0) {
      res.push_back(str);
    }
  }
  return res;
}

int main() {
  string str;
  while (getline(cin, str)) {
    vector<string> strs=split(str," ");
    int key=0;
    if (strs.size()!=0) {
      for (int i=0; i<strs.size(); i++) {
	while (strs[i].find(".")!=string::npos) {
	  strs[i].erase(strs[i].find("."));
	}
	if (strs[i].length()==3&&strs[i][0]-'t'==strs[i][1]-'h'&&strs[i][1]-'h'==strs[i][2]-'e') {
	  key = strs[i][0]-'t';
	  break;
	} else if (strs[i].length()==4) {
	  if (strs[i][0]-'t'==strs[i][1]-'h'&&strs[i][1]-'h'==strs[i][2]-'a'&&strs[i][2]-'a'==strs[i][3]-'t') {
	    key = strs[i][0]-'t';
	    break;
	  }
	  if (strs[i][0]-'t'==strs[i][1]-'h'&&strs[i][1]-'h'==strs[i][2]-'i'&&strs[i][2]-'i'==strs[i][3]-'s') {
	    key = strs[i][0]-'t';
	    break;
	  }
	}
      }
    } else {
      string tmp=str;
      while (tmp.find(".")!=string::npos) {
	  tmp.erase(tmp.find("."));
      }
      if (tmp.length()==3&&tmp[0]-'t'==tmp[1]-'h'&&tmp[1]-'h'==tmp[2]-'e') {
	key = tmp[0]-'t';
      } else if (tmp.length()==4) {
	if (tmp[0]-'t'==tmp[1]-'h'&&tmp[1]-'h'==tmp[2]-'a'&&tmp[2]-'a'==tmp[3]-'t') {
	  key = tmp[0]-'t';
	}
	if (tmp[0]-'t'==tmp[1]-'h'&&tmp[1]-'h'==tmp[2]-'i'&&tmp[2]-'i'==tmp[3]-'s') {
	  key = tmp[0]-'t';
	}
      }
    }
    for (int i=0; i<str.length(); i++) {
      if (isalpha(str[i])) {
	str[i]-=key;
      }
    }
    cout<<str<<endl;
  }
}