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>
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;
  }
}

C++: #include <iostream>
#include <string>
using namespace std;
int main()
{
	int i, j;
	string s, res, tmp;
	while (!cin.eof())
	{
		getline(cin, s);
		res = tmp = s;
		for (i = 0; i < 27; i++)
		{
			res = tmp;
			for (j = 0; j < (int)s.length(); j++)
			{
				if (s[j] != ' ' && s[j] != '.')
				{
					if (s[j] + i > 'z')
						res[j] = 'a' + s[j] + i - 'z' - 1;
					else
						res[j] = s[j] + i;
				}
				else
				{
					res[j] = s[j];
				}
			}
			if (res.find("the") != string::npos || res.find("this") != string::npos || res.find("that") != string::npos)
				break;
		}
		cout << res << endl;
	}
}

C++: #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main() {
	string str;
	getline(cin, str);
	for (int i = 0; i < str.size(); i++) {
		if (str[i] >= 'E' && str[i] <= 'Z') {
			str[i] += 'A' - 'E';
		}
		else if (str[i] >= 'e' && str[i] <= 'z') {
			str[i] += 'a' - 'e';
		}
		else if (str[i] >= 'A' && str[i] < 'E') {
			str[i] -= 'A' - 'W';
		}
		else if (str[i] >= 'a'&&str[i] < 'e') {
			str[i] -= 'a';
			str[i] += 'w';
		}
		cout << str[i];
	}
	cout << endl;

	return 0;
}

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

char convNext(char ch) {
	if('a' <= ch && ch <= 'y') return ch+1;
	if(ch=='z')return 'a';
	return ch;
}
int main() {
	char str[90];
	while(true) {
		if(!fgets(str, 90, stdin))break;
		for(int i = 0; i < 26; i++) {
			if(strstr(str,"this") || strstr(str,"that") || strstr(str,"the"))break;
			for(int j = 0; str[j]; j++) {
				str[j]=convNext(str[j]);
			}
		}
		fputs(str, stdout);
	}
	return 0;
}

C++: #include <iostream>
#include <string>
#include <cctype>
using namespace std;
int main() {
  string s;
  while(getline(cin, s)) {
    for (int i=0; i<26; i++) {
      string s2(s);
      for (int j=0; j<s.length(); j++) {
        if (isalpha(s[j]))
          s2[j] = (s[j]-'a'+i) % 26 + 'a';
      }
      if (s2.find("the")!=-1||s2.find("this")!=-1||s2.find("that")!=-1) {
        cout << s2 << endl;break;
      }
    }
  }
}