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 <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 continue;
                }
            }
        }
    }
    end:
    cout << str << endl;
    
    return 0;
}

C++: #include <iostream>
#include <string.h>
#include <string>
#include <stdio.h>
using namespace std;
int main() {
	char st[80];
	string w[3]={"the","this","that"};
	int wn[3]={3,4,4},k,i,j,s,f,z;
	while(true) {
    k=0; z=0;
	scanf("%[^0]",st);
	z=strlen(st);
	while(k<z) {
		for (i=0;i<3;i++) {
			s=0; f=0;
			if (z<k+wn[i]) break;
			for (j=0;j<wn[i]-1;j++) if ((w[i][j]-w[i][j+1])==(st[k+j]-st[k+j+1])) s++;
			if (s==wn[i]-1 && (st[k+wn[i]]<'a' || st[k+wn[i]]>'z' ))  { f=1; i=5;}
		}
		if (f==1) break;
		for (k;st[k]>='a' && st[k]<='z';k++);
		k++;
		}
	if (f==0) cout << st; else {
	for (i=0;i<z;i++) if ((st[i]>='a' && st[i]<='z')) cout << (char)(st[i]-(st[k]-'t')) ; else cout << st[i];
	  }	
	}
    return 0;
	}

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


int main()
{
	string str;
	int len;
	int i,j;
	while(1) {
		getline(cin,str);
		if(cin.eof())
			break;

		len = str.length();
		for(i = 0; i < 26; 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>
#include<string>
using namespace std;

int main(){
  string word;
  string com[3]={"the","this","that"};
  int cou=0;

  while(1){
    //bool flag = false;
    getline(cin,word);
    if(cin.eof()){
      break;
    }
    while(1){
      bool flag = false;
      for(int i=0;i<word.size();i++){
	if(word[i] == 'z'){
	  word[i] = 'a';
	}
	else if(word[i] >= 'a' && word[i] <= 'z'){
	  word[i]++;
	}
      }
      for(int i=0;i<3;i++){
	int index = word.find(com[i],0);
	if(index != string::npos){
	  cout << word << endl;
	  flag = true;
	  break;
	}
      }
      if(flag == true) break;
    }
  }
}

C++: #include <bits/stdc++.h>

using namespace std;

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

C++: #include<bits/stdc++.h>
using namespace std;
int main()
{
    string str;
    while(getline(cin,str)){
            while(1){
                if(str.find("the")!=-1||str.find("that")!=-1||str.find("this")!=-1)break;
                for(int i=0;i<str.size();i++){
                    if(str[i]=='.'||str[i]==' '){}
                    else str[i]--;
                }
            }
            cout<<str<<endl;
    }

}

C++: #include <bits/stdc++.h>

using namespace std;

int main (){
    //freopen("input.txt" , "r", stdin);
    string str1;
    while(getline (cin, str1)){
            
    int cnt =0;

    for(int i=1; i<27; i++){

        cnt++;

        for(int j=0; j<str1.size(); j++){
            if(str1[j]>= 'a' && str1[j]<= 'z'){
                int ascii = (int)  97+ (((str1[j] % 97) + 1) %26);
                str1[j] = ascii;
            }
            else str1[j] = str1[j];
        }

        //cout<<str1<<endl;

        int position =0, flag =0;

        if((position = (str1.find("this"))) != -1 ){
            flag = 1;
            break;
        }

        else if((position = (str1.find("the"))) != -1 ){
            flag = 1;
            break;
        }

        else if((position = (str1.find("that"))) != -1 ){
            flag = 1;
            break;
        }
    }

    //cout<<"The key: "<<cnt<<endl;
    cout<<str1<<endl;
    str1.clear();

    }


    return 0;
}

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

int main() {
  string str,s;
  int key,word;
  vector<string> seq;
  char decode[4],ans;
  while(getline(cin,str)) {
    seq.clear();
    stringstream ss;
    ss << str;
    while(ss >> s) {
      seq.push_back(s);
    }
    ss.str("");
    ss.clear(stringstream::goodbit);

    word = seq.size();
    key = 100;

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

	decode[0] = *seq[i].substr(0,1).c_str();
	decode[1] = *seq[i].substr(1,1).c_str();
	decode[2] = *seq[i].substr(2,1).c_str();
	decode[3] = *seq[i].substr(3,1).c_str();

	for(int j=1;j<27;j++) {
	  for(int k=0;k<4;k++) {
	    decode[k] -= 97; //a-z 0-25
	    decode[k]++;//1-26
	    decode[k] %= 26;//0-25
	    decode[k] += 97;//97-122
	  }
	  if( (decode[0] == 't' && decode[1] == 'h' && decode[2] == 'e') && (seq[i].size() == 3)) {
	    key = j;
	    break;
	  }
	  if( (decode[0] == 't' && decode[1] == 'h' && decode[2] == 'i' && decode[3] == 's') && (seq[i].size() == 4) ) {
	    key = j;
	    break;
	  }
	  if( (decode[0] == 't' && decode[1] == 'h' && decode[2] == 'a' && decode[3] == 't') && (seq[i].size() == 4) ){
	    key = j;
	    break;
	  }
	}
      
      if(key!=100) break;
    }

    for(int i=0;i<word;i++) {
      for(unsigned int j=0;j<seq[i].size();j++) {
	ans = *seq[i].substr(j,1).c_str();
	if(ans <= 'z' && 'a' <= ans){
	  ans -= 97;
	  ans += key;
	  ans %= 26;
	  ans += 97;
	}
	cout << ans;
      }
      if(i==word-1) {
	break;
      }
      cout << " ";
      
    }
    cout << endl;
  }
}