Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func incrementByte(b byte) byte {
	if b >= 97 && b < 122 {
		return b + 1
	} else if b == 122 {
		return 97
	}
	return b
}

func main() {
	scanner.Split(bufio.ScanLines)

	for {
		line := nextString()
		if len(line) == 0 {
			break
		}
		for i := 0; i <= 26; i++ {
			decoded := []byte{}
			for j := 0; j < len(line); j++ {
				decoded = append(decoded, incrementByte(line[j]))
			}
			line = string(decoded)
			if strings.Contains(line, "the") || strings.Contains(line, "this") || strings.Contains(line, "that") {
				fmt.Println(line)
				break
			}
		}
	}
}

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

int main(){
    string before;
    while (getline(cin, before)) {
        int swich = 0;
        for (int i = 0;i < 27 ;i++) {
            for (int j = 0; j < before.size(); j++) {
                if (before[j]>'z') {
                    before[j] = 'a';
                }
                else if (isalpha(before[j])) {
                    before[j]++;
                }
            }
            for (int j = 0; j < before.size(); j++) {
                if (before[j]=='t'&& before[j+1]=='h'&& before[j+2]=='e') {
                    if (before[j+3]==' '|| before[j+3]=='.'|| before[j+3] == '\n') {
                        swich = 1;
                        break;
                    }
                }
                else if (before[j]=='t'&&before[j+1]=='h'&&before[j+2]=='a'&&before[j+3]=='t') {
                    if (before[j+4]==' '||before[j+4]=='.'|| before[j+4] == '\n') {
                        swich = 1;
                        break;
                    }
                }
                else if (before[j]=='t'&&before[j+1]=='h'&&before[j+2]=='i'&&before[j+3]=='s') {
                    if (before[j+4]==' '||before[j+4]=='.'|| before[j+4] == '\n') {
                        swich = 1;
                        break;
                    }
                }
            }
            if (swich == 1) {
                break;
            }
        }
        cout << before << endl;
    }
    return 0;
}

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

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

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

int main() {
	string st;
	string w[3]={"the","this","that"};
	int wn[3]={3,4,4},k,i,j,s,f;
	while(getline(cin,st)) {
    k=0;
	while(true) {
		for (i=0;i<3;i++) {
			s=0; f=0;
			if (st.size()<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++);
		if (k>=st.size()) break;
		k++;
		}
	if (f==0) cout << st; else {
	for (i=0;i<st.size();i++) if ((st[i]>='a' && st[i]<='z')) cout << (char)(st[i]-(st[k]-'t')) ; else cout << st[i];
	}	
	cout << endl;
	}
    return 0;
	}

C++: #include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++) 
#define ALL(n) begin(n),end(n)
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
int main()
{
    string S;
    while( getline( cin, S ) )
    {
        while( S.find( "the" ) != string::npos || S.find( "this" ) != string::npos || S.find( "that" ) != string::npos )
        {
            REP( i, (int)S.size() )
            {
                if( S[ i ] != ' ' && S[ i ] != '.' )
                {
                    if( S[ i ] == 'z' )
                    {
                        S[ i ] = 'a';
                        continue;
                    }
                    S[ i ]++;
                }
            }
        }
        cout << S << endl;
    }
    return 0;
}

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

/*他人のパクリ　アスキーコードの文字から数値への変換が出来なかった*/
int main() {
	string ac;
	while (getline(cin, ac)) {
		while ((ac.find("the") == -1) && (ac.find("this")==-1) && (ac.find("that") == -1)) {
			for (int i = 0; i < ac.size(); i++) {
				if ('a' <= ac[i] && ac[i] < 'z') {
					ac[i] += 1;
				}
				else if (ac[i]=='z'){
					ac[i] = 'a';
				}
			}

		}
		cout << ac << endl;
	}
	return 0;
}

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

int main(void){
  int len, cnt;
  string str;

  while(getline( cin, str )){
    len = str.length();
    cnt = 0;

    while(true){
      if( str.find("the", 0) != string::npos
	  || str.find("this", 0) != string::npos 
	  || str.find("that", 0) != string::npos
	)
	break;
      for(int i = 0; i < len; i++){
	if( 'a' <= str[i] && str[i] <= 'z' ){
	  str[i]++;
	  if(str[i] > 'z')
	    str[i] = 'a';
	}
      }
      
      cnt++;
      if(cnt > 30)
	break;
    }
    
    cout << str << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
bool isAlpha(char c){
	return ('a' <= c && c <= 'z');
}
char getShift(char c, int v){
	if (0 == v) return c;
	return char('a' + int(c + v + 26 - 'a') % 26);
}
int getShiftIndex(string& line){
	int s = line.size();
	string::size_type ps = 0, pe = 0;
	while (true){
		while (ps < s && !isAlpha(line[ps])) ++ps;
		pe = ps;
		while (pe < s && isAlpha(line[pe])) ++pe;
		if (ps >= s || pe >= s)
			break;
		int len = pe - ps;
		if (3 == len){
			if(	   line[ps] == getShift(line[ps + 1], 12)
				&& line[ps] == getShift(line[ps + 2], 15))
				return int('t' - char(line[ps]));
		}
		else if (4 == len){
			if(	   line[ps] == getShift(line[ps + 1], 12)
				&& line[ps] == getShift(line[ps + 2], 11)
				&& line[ps] == getShift(line[ps + 3], 1))
				return int('t' - char(line[ps]));
			if (   line[ps] == getShift(line[ps + 1], 12)
				&& line[ps] == getShift(line[ps + 2], 19)
				&& line[ps] == getShift(line[ps + 3], 0))
				return int('t' - char(line[ps]));
		}
		ps = pe;
	}
	return -1;
}

int main()
{
	string line;
	while (std::getline(cin, line)){
		int s = line.size();
		int v = getShiftIndex(line);
		for (int i = 0; i < s; ++i){
			char c = line[i];
			if (isAlpha(c)) cout << getShift(c, v);
			else cout << c;
		}
		cout << "\n";
	}
	return 0;
}