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>
using namespace std;
int main() {
	int t,u;
	int i;
	string s;
	while (getline(cin, s)) {
		t = 0;
		u = s.size();
		while (t==0) {
			for (i = 0; i < u; i++) {
				if (s[i] == 'z') {
					s[i] = 'a';
				}
				else if('a'<=s[i]&&s[i]<'z') {
					s[i] += 1;
				}
			}
			while (s.find("the") != string::npos || s.find("this") != string::npos || s.find("that") != string::npos) {
				t = 1;
				break;
			}
		}
		cout << s << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <string>
using namespace std;
int main() {
	string str;
	while(getline(cin, str)) {
		int n = 't' - str[0];
		for(int i = 0; str[i] != '\0'; i++) {
			if(('a' <= str[i])&&(str[i] <= 'z')) {
				str[i] += n;
				if(str[i] > 'z') {
					str[i] = str[i] - 26;
				}
			}
		}
		cout << str << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <string>

using namespace std;

string str;

bool caesar()
{
	bool flag = false;

	for (int i=0; i<(int)str.size() - 3; i++)
	{
		if(str[i] == 't' && str[i+1] == 'h') {
			if(str[i+2] == 'e' && (str[i+3] == ' ' || str[i+3] == '\0')) {
				flag = true;
				break;
			}
			if(str[i+2] == 'i' && str[i+3] == 's' && (str[i+4] == ' ' || str[i+4] == '\0')) {
				flag = true;
				break;
			}
			if(str[i+2] == 's' && str[i+3] == 't' && (str[i+4] == ' ' || str[i+4] == '\0')) {
				flag = true;
				break;
			}
		}
	}

	return flag;
}


int main()
{
	getline(cin, str);

	for (int i=0; i<25; i++)	//25文字ずれるまで繰り返す
	{
		if(caesar()) {
			cout << str << endl;
		}

		for (int j=0; str[j] != '\0'; j++) {
			if(str[j] != ' ' && str[j] != '.') {
				if(str[j] == 'z') {
					str[j] = 'a';
				}
				else {
					str[j]++;
				}
			}
		}
	}

	return 0;
}

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

int main(){

  int n;
  string s;
  int k;

  getline(cin,s);

  for(int i=-25;i<26;i++){
    bool d = false;
 
    for(int j=0;j<s.size();j++){

      if((s[j-1] == ' ' || j == 0) && s[j]+i == 't' && s[j+1]+i == 'h'){
	if(s[j+2]+i == 'e' && (s[j+3] == ' ' || j+3 == s.size())) d = true;
	if(s[j+2]+i == 'i' && s[j+3]+i == 's' && (s[j+4] == ' ' || j+4 == s.size())) d = true;
	if(s[j+2]+i == 'a' && s[j+3]+i == 't' && (s[j+4] == ' ' || j+4 == s.size())) d = true;
      }

      if(d == true) break;
    }

    if(d == true){
      k = i;
      break;
    }

  }

  for(int i=0;i<s.size();i++){
    if(s[i] >= 'a' && s[i] <= 'z') printf("%c",s[i]+k);
    else printf("%c",s[i]);
  }

  cout << endl;
}

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

bool checkString(int* key, string s);
void rotateChar(string* s, int i);

int main()
{
    string text;
	while( getline(cin, text) ){
		char ch;
		string s;
		list<string> table;
		for(int i=0; i<text.size(); i++){
			ch = text[i];
			if(ch!=' ')s.push_back(ch);
			else{ table.push_back(s), s.clear();}
		}		

		int key; // ずらす文字数
		list<string>::iterator i;
		for(i=table.begin(); i!=table.end(); i++){
			// cout << *i << " ";
			if( i->size() == 3 || i->size() == 4 )
				if( checkString(&key, *i) ) break;
		}
	
		for(int i=0; i<text.size(); i++){
			char ch = text[i];
			if(isalpha(ch)){
				char c = ch - 'a';
				ch = 'a' + (c+key)%26;
			}
			cout.put(ch);
		}
		cout << endl;
		text.clear();
	}
    return 0;
}

void rotateChar(string* s, int i) // iは何文字ずらしたいか
{

    for(int j=0; j<s->size(); j++){
        if(!isalpha(s->at(j))){continue;}
        char c = s->at(j) - 'a';
        s->at(j) = 'a' + (c+i)%26;
    }
}

bool checkString(int* key, string s)
{

    for(int i=0; i<26; i++){
        string tmp = s;
        rotateChar(&tmp, i);
        // cout << tmp << endl;
        if( tmp=="the" || tmp=="this" || tmp=="that" ){
            *key=i;
            return true;
        }
    }
    return false;
}

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;

//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(){
   vector<string> a;
   string b;
   int x;

   while(cin>>b){
      if(b.size()==3&&b[0]-'t'==b[1]-'h'&&b[1]-'h'==b[2]-'e')
         x=b[0]-'t';
      else if(b.size()==4&&b[0]-'t'==b[1]-'h'&&b[1]-'h'==b[2]-'i'
      &&b[2]-'i'==b[3]-'s') x=b[0]-'t';
      else if(b.size()==4&&b[0]-'t'==b[1]-'h'&&b[1]-'h'==b[2]-'a'
      &&b[2]-'a'==b[3]-'t') x=b[0]-'t';     
      a.PB(b);
   }
   REP(i,a.size()){
      REP(j,a[i].size()) if(a[i][j]!='.') a[i][j]-=x;
   }
   REP(i,a.size()){
      cout << a[i];
      if(i!=a.size()-1) cout << " ";
   }
   cout << endl;
   return 0;
}