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<cstdio>
using namespace std;
int main()
{
    char a[1500]={0};
    while(scanf("%[^\n]",a)!=EOF)
    {
        getchar();
        for(;;)
        {
            for(int i=0;;i++)
            {
                if(a[i]==0)break;
                if(a[i]==122)a[i]=97;
                else if(97<=a[i]&&a[i]<122)a[i]++;
                else;
            }
            for(int i=0;;i++)
            {
                if(a[i]==0)break;
                if(a[i]=='t'&&a[i+1]=='h'&&a[i+2]=='i'&&a[i+3]=='s'&&(a[i+4]==' '||a[i+4]=='.'||a[i+4]==0))goto end;
                if(a[i]=='t'&&a[i+1]=='h'&&a[i+2]=='a'&&a[i+3]=='t'&&(a[i+4]==' '||a[i+4]=='.'||a[i+4]==0))goto end;
                if(a[i]=='t'&&a[i+1]=='h'&&a[i+2]=='e'&&(a[i+3]==' '||a[i+3]=='.'||a[i+3]==0))goto end;
            }
        }
        end:;
        printf("%s\n",a);
        for(int i=0;i<1500;i++)
        {
            a[i]=0;
        }
    }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main()
{
  string str;

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

C++: /*0017 written by iPhone*/
#include <iostream>
#include <string>

using namespace std;

int main(){
    string s;
    while(getline(cin, s) && s != "\0"){
        for(int i = 0; i < s.size(); i++) s[i]++;
        if(s.find("the") != -1 || s.find("this") != -1 || s.find("that") != -1 ){
            cout << s;
            return 0;
        }
    }
    return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main(){
  string s;
  int pl=0;
  getline(cin,s);
  for(int i =-27;i<27;i++){
    for(int j = 0; j < s.size(); j++){
      if(s[j]+i=='t' &&s[j+1]+i == 'h' && s[j+2]+i == 'e'){
	pl = i;
	break;
      }
      else if(s[j]+i=='t' &&s[j+1]+i == 'h' && s[j+2]+i == 'a' && s[j+3]+i=='t'){
	pl = i;
	break;
      }
      else if(s[j]+i=='t' &&s[j+1]+i == 'h' && s[j+2]+i == 'i' && s[j+3]+i=='s'){
	pl = i;
	break;
      }
    }
    if(pl!=0) break;
  }
  for(int i=0;i <s.size();i++){
    if(s[i]<='z' && s[i]>='a') s[i] += pl;
  }
  cout<<s<<endl;
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <functional>
#include <sstream>
using namespace std;

#define REP(i,a,n) for(int i=(a);i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()

string chipher(string tmp, int k){
	rep(i,tmp.size())if( 'a'<=tmp[i] && tmp[i]<='z' ){
		if( tmp[i]+k>'z' ){
			tmp[i] = (tmp[i]+k-'z'-1)+'a';
		}else{
			tmp[i] = tmp[i]+k;
		}
	}
	return tmp;
}
int main(){
	string in;
	while(getline(cin,in)){
		rep(i,26){
			string tmp = chipher(in,i);
			if( tmp.find("this")!=string::npos || tmp.find("the")!=string::npos ||
					tmp.find("that")!=string::npos ){
					
				cout << tmp << endl; break;
			}
		}
	}
	return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <string.h>
#include <string>
#include <algorithm>
#include <vector>

using namespace std;

void q17() {
	vector<string> hints = { "the","this","that" };
	vector<vector<string>> shiftHints;
	for (int i = 0; i < 26; i++) {
		vector<string> iShiftHints;
		for (int j = 0; j < hints.size(); j++) {
			string tmp = "";
			for (int k = 0; k < hints[j].length(); k++) {
				char z = ((hints[j][k] - 'a' + i) % 26) + 'a';
				tmp += ((hints[j][k] - 'a' + i) % 26) + 'a';
			}
			iShiftHints.push_back(tmp);
		}
		shiftHints.push_back(iShiftHints);
	}

	string str;
	for (; getline(cin, str);) {
		int s;
		bool flag = false;
		for (s = 0; s < 26; s++) {
			for (int i = 0; i < hints.size(); i++) {
				if (str.find(shiftHints[s][i]) != -1) {
					flag = true;
				}
			}
			if (flag) break;
		}

		string ans = "";
		for (int i = 0; i < str.length(); i++) {
			if ('a' <= str[i] && str[i]<= 'z') {
				ans += (str[i] - 'a' - s) % 26 + 'a';
			}
			else {
				ans += str[i];
			}
		}
		cout << ans << endl;
	}
}

int main() {
	q17();
	return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <cmath>
using namespace std;

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define llong long long

int main() {
  char *a = (char*)malloc(sizeof(char)*82);
  size_t l = 0;
  while (getline(&a, &l, stdin) != EOF) {
    while(1) {
      int q = 0;//1..t, 2..th, 3..the, 4...thi, 5..this, 6..tha, 7..that 
      REP(j , (int)l-1) {
	if(a[j] == 'z') a[j] = 'a';
	else if(a[j] >= 'a' && a[j] < 'z') a[j]++;
      }
      REP(j , (int)l-1) {
	switch(q){
	case 0:
	  if(a[j] == 't') q++;
	  break;
	case 1:
	  if(a[j] == 'h') q++;
	  else q = 0;
	  break;
	case 2:
	  if(a[j] == 'e') q = 3;
	  else if(a[j] == 'i') q = 4;
	  else if(a[j] == 'a') q = 6;
	  else q = 0;
	  break;
	case 4:
	  if(a[j] == 's') q = 5;
	  else q = 0;
	  break;
	case 6:
	  if(a[j] == 't') q = 7;
	  else q = 0;
	  break;
	}
      }
      if(q == 3 || q == 5 || q == 7) break;
    }
    
    REP(i , (int)l-1) {
      printf("%c",a[i]);
    }
  }
  return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
#define rer(i,l,n) for(int i=l;i<=n;i++)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define pb(a) push_back(a)
#define mk(a,b) make_pair(a,b)
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

string change(string s,int n){
	string ret(s);
	rep(i,0,ret.size()){
		if(ret[i]>='a' && ret[i]<='z'){
			if(ret[i]+n>'z') ret[i]+=n-26;
			else ret[i]+=n;
		}
	}
	return ret;
}

int main(){
	string s;
	string str[3]={"this","that","the"};
	string stu[2]={" ","."};
	while(getline(cin,s)){
		rep(i,1,26){
			string t;
			t=change(s,i);
			bool f=0;
			rep(j,0,3){
				rep(k,0,2){
					if(t.find(str[j]+stu[k])!=string::npos){
						o(t); f=1; break;
					}
				}
				if(f) break;
			}if(f) break;
		}
	}
}