Go: package main

import (
	"bufio"
	"os"
	"strings"
	"fmt"
)

var scanner = bufio.NewScanner(os.Stdin)

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 scanner.Scan() {
		infos := strings.Split(scanner.Text(), " ")
		plain := make([]string, len(infos))
		// 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 <string>
#include <stdlib.h>
#define substr(source,a,b,destination) destination="";for(int i=a;i<b;i++)destination+=source[i]
using namespace std;

int main(void){
	string str;

	while(getline(cin,str)){
		for(int cif=0;cif!=26;cif++){
				for(int i=0;i<str.length();i++){
					if('A'<=str[i]&&str[i]<='Z'){
						str[i]=(str[i]-'A'+1)%26+'A';
					}else if('a'<=str[i]&&str[i]<='z'){
						str[i]=(str[i]-'a'+1)%26+'a';
					}
				}
			for(int i=0;i<str.length();i++){
				string g="";
				int j=i;
				while(i!=str.length()&&str[i]!=' ')g+=str[i++];
				if(g=="that" || g=="the"||g=="this"){
					cout<<str<<endl;
					break;
				}
			}
		}
	}
	return 0;
}

C++: //include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <queue>
#include <iterator>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;
using namespace string;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int gcd(int a, int b){
   int tmp;
   while(a%b==0){
      tmp=a%b;
      a=b;
      b=tmp;
   }
}

int lcm(int a,int b){
   return a*b/gcd(a,b);
}

bool prime_number(int n){
   if(n < 2){
      return false;
   }
   else if(n == 2){
      return true;
   }
   if(n % 2 == 0){
      return false;
   }
   for(int i=3;i<=n/i;i+=2){
      if(n % i == 0) return false;
      return true;
   }
}

int main(){
   string a;

   while(getline(cin,a)){
      while(a.find("the")==npos&&a.find("this")==npos&&str.find("that")==npos)
         REP(i,a.size()){
            if(a[i]=='z') a[i]=='a';
            else if(a[i]>=a&&a[i]<='z') a[i]++;
         }
      cout << a << endl;
   }
   return 0;
}

C++: #include<stdio.h>
#include<string>
#include<stdlib.h>
int main()
{
int i,l;
char ch[90];
while(1){
getline(cin,ch);
l=strlen(ch);
for(i=0;i<l;i++){
if(ch[i]>='a'&&ch[i]<='z'){

if(ch[i]=='a'||ch[i]=='b'||ch[i]=='c'||ch[i]=='d'){
if(ch[i]=='a'){
ch[i]='w';

}
else if(ch[i]=='b'){
ch[i]='x';

}
else if(ch[i]=='c'){
ch[i]='y';

}

else if(ch[i]=='d'){
ch[i]='z';
}

}
else {
ch[i]=ch[i]-4;
}
}
}
printf("%s\n",ch);


}
return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <ctype.h>

using namespace std;

inline char rotate(char c, int x){
    int r = x % 26;
    if(isalpha(c)){
        c -= 'a';
        c += r;
        c += 'a';
    }

    return c;
}

int main(int argc, char const* argv[])
{
    char buf[82];
    int dif;

    while (nullptr != fgets(buf, 82, stdin)) {
        dif = 't' - buf[0];
        for (int i = 0; ; i++) {
            if(buf[i] == '\0'){
                buf[i] = '\0';
                puts(buf);
                break;
            }
            buf[i] = rotate(buf[i], dif);
        }
    }

        return 0;
}

C++: #include <fstream>
#include <iostream>
#include <cmath>
#include <vector>
#include <queue>
#include <utility>
#include <algorithm>
using namespace std;

char shift(char c, int n) {
  if (c >= 'a' && c <= 'z')
    return (c + n <= 'z') ? c + n : 'a' + (c + n - 'z' - 1);
  else
    return c;
}

bool exist(string str, string c) {
  return str.find(c, 0) != string::npos;
}

int main() {
  // ifstream cin("../test.txt");
  vector<string> _the(26);
  vector<string> _this(26);
  vector<string> _that(26);
  _the[0] = "the";
  _this[0] = "this";
  _that[0] = "that";
  for (int i = 1; i < 26; i++) {
    for (int j = 0; j < 3; j++) {
      _the[i] += shift(_the[0][j], i);
    }
    for (int j = 0; j < 4; j++) {
      _this[i] += shift(_this[0][j], i);
      _that[i] += shift(_that[0][j], i);
    }
  }

  string str, nstr;
  // 復号化
  while (getline(cin, str)) {
    if (str.length() == 0) break;
    nstr = "";
    for (int i = 1; i < 26; i++) {
      if ( exist(str, _the[i]) || exist(str, _this[i]) || exist(str, _that[i])) {
        int len = str.length();
        for (int j = 0; j < len; j++) {
          nstr += shift(str.at(j), 26 - i);
        }
        break;
      }
    }

    cout << nstr << endl;
  }
  // 暗号化
  // while (getline(cin, str)) {
  //   for (int i = 1; i < 26; i++) {
  //     nstr = "";
  //     int len = str.length();
  //     for (int j = 0; j < len; j++) {
  //       nstr += shift(str[j], i);
  //     }
  //     cout << nstr << endl;
  //   }
  // }
}

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

char cShiftchar(char ch)
{
    if(isalpha(ch))
    {
        if(islower(ch))
        {
        ch++;
        if(ch > 'z') ch = ch - 'z' + 'a' -1;
        }
        if(isupper(ch))
        {
        ch++;
        if(ch > 'Z') ch = ch - 'Z' + 'A' -1;
        }
    }

    return ch;
}

string sDecode(string str)
{
    string ans;
    while( str.find("the")
            && str.find("this")
            && str.find("that")
            && str.find("THE")
            && str.find("THIS")
            && str.find("THAT")
         )
    {
        transform(str.begin(), str.end(), str.begin(), cShiftchar);

    }
    return str;
}

int main()
{
    string str;
    while(getline(cin, str))
    {
        cout << sDecode(str) << endl;
    }
    return EXIT_SUCCESS;
}