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 <bits/stdc++.h>
using namespace std;

int main() {
	ios_base::sync_with_stdio( false );

	string tb = "abcdefghijklmnopqrstuvwxyz";
	string s;

	while( getline( cin, s ) ) {
		string t( s.size(), ' ' );

		for( int i = 0; i < tb.size(); ++i ) {
			transform( s.begin(), s.end(), t.begin(), [tb, i]( char c ) {
				return (char)(c >= 'a' && c <= 'z' ? tb[(c-'a' + i) % tb.size()] : c);
			} );

			if( t.find( "the"  ) != string::npos ) { break; }
			if( t.find( "this" ) != string::npos ) { break; }
			if( t.find( "that" ) != string::npos ) { break; }
		}

		cout << t << '\n';
	}
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <functional>
#include <complex>

using namespace std;

const double PI=3.14159265;

int main()
{
	string s,t;
	getline(cin,s);

	for(int i=1;i<=26;i++){
		t=s;
		for(unsigned int j=0;j<s.size();j++){
			if(t[j]>='a' && t[j]<='z') t[j]=(t[j]+i)%26+'a';
		}
		if(t.find("the")!=string::npos || t.find("this")!=string::npos
		   ||t.find("that")!=string::npos){
			cout<<t<<endl;
			break;
		}
	}
	return 0;
}

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

using namespace std;

void solve()
{
	string str;
	getline(cin, str);
	string word;
	int n = str.size();
	for(int j = 0; j < 26; ++j)
	{
		word.clear();
		for(int i = 0; i < n; ++i)
		{
			if('a' <= str[i] && str[i] <= 'z')
			{
				word += (str[i] + j -'a') % 26 + 'a';
			}
			else
			{
				word += str[i];
			}
		}
		if(word.find("this") != -1 || word.find("the") != -1 || word.find("that") != -1)
		{
			cout << word << endl;
		}
	}
}

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

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

int main()
{
    string s;
    while (getline(cin, s))
    {
        for(int n=0; n<26; n++)
        {
            for(int i=0; i<s.size(); i++)
            {
                if(s[i] >= 'a' && s[i] < 'z')
                {
                    s[i]=s[i]+1;
                }
                else if(s[i] == 'z')
                {
                    s[i] = 'a';
                }
                else
                {

                }
            }
            if(  s.find("the")  != std::string::npos
              || s.find("this") != std::string::npos
              || s.find("that") != std::string::npos)
            {
                cout << s << endl;
                break;
            }
        }
    }

    return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(i=0;i<n;i++)
#define loop(i,a,n) for(i=a;i<n;i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

typedef vector<int> vi;
typedef pair<int,int> pii;

int main(void) {
  int i,j,k;
  string s;
  while(getline(cin,s)){
    int n=0;
    rep(i,s.size())if(s[i]==' ')n++;
    n++;
    vector<string> word(n);
    i=0;
    rep(j,n){
      while(s[i]>='a' && s[i]<='z')
    word[j].push_back(s[i]),i++;
      i++;
    }
    rep(k,26){
      bool c=false;
      rep(i,n)rep(j,word[i].size())
    if(word[i][j]=='z')word[i][j]='a';
    else word[i][j]=word[i][j]+1;
      rep(i,n)
    if(word[i]=="the" || word[i]=="this" || word[i]=="that"){
      c=true;break;
    }
      if(c){
    rep(i,n){
      if(i)cout<<" ";
      cout<<word[i];
    }
    cout<<endl;
    break;
      }
    }
  }
}

C++: #include<cstdio>
#include<iostream>
#include<cstring>

using namespace std;

int the[2],that[3],_this[3];

bool checkThe(char s[]){
  if(strlen(s)!=3){
    return false;
  }else{
    if(s[0]-s[1]==the[0] && s[1]-s[2]==the[1]){
      return true;
    }
  }
  return false;
}
bool checkThis(char s[]){
  if(strlen(s)!=4){
    return false;
  }else{
    if(s[0]-s[1]==_this[0] && s[1]-s[2]==_this[1] && s[2]-s[3]==_this[2]){
      return true;
    }
  }
  return false;
}
bool checkThat(char s[]){
  if(strlen(s)!=4){
    return false;
  }else{
    if(s[0]-s[1]==that[0] && s[1]-s[2]==that[1] && s[2]-s[3]==that[2]){
      return true;
    }
  }
  return false;

}
int main(){
  int key=0;
  char str[100];
  char temp[100];
 

  the[0]='t'-'h';
  the[1]='h'-'e';

  that[0]='t'-'h';
  that[1]='h'-'a';
  that[2]='a'-'t';

  _this[0]='t'-'h';
  _this[1]='h'-'i';
  _this[2]='i'-'s';
    
  char *tok;
  bool f=false;
  while(fgets(str,sizeof(str),stdin)!=NULL){
  
    for(int i=0;i<strlen(str);i++)
      temp[i]=str[i];
    temp[strlen(str)]='\0';

    str[strlen(str)]='\0';
    str[strlen(str)-1]='\0';
    tok=strtok(str," ");
 
    if(strlen(tok)==3){
      if(checkThe(tok)==true){
	key=tok[0]-'t';
	f=true;
      }
    }else if(strlen(tok)==4){
      if(checkThat(tok)==true){
	key=tok[0]-'t';
	f=true;
      }else if(checkThis(tok)==true){
	key=tok[0]-'t';
	f=true;
      }
    }
    while(f==false && tok!=NULL){
      tok=strtok(NULL," ");
      if(tok!=NULL){
	if(strlen(tok)==3){
	  if(checkThe(tok)==true){
	    key=tok[0]-'t';
	    f=true;
	  }
	}else if(strlen(tok)==4){
	  if(checkThat(tok)==true){
	    key=tok[0]-'t';
	    f=true;
	  }else if(checkThis(tok)==true){
	    key=tok[0]-'t';
	    f=true;
	  }
	}
      }
    }
   
    for(int i=0;i<strlen(temp);i++){
      if('a'<=str[i] && str[i]<='z'){
	printf("%c",temp[i]-key);
      }else{
	printf("%c",temp[i]);
      }
    }

  }

  return 0;
}

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

int main() {
  string s;
  getline(cin, s);

  bool b = false;
  for(int i = 1; i < 26; i++) {
    string change;
    for(int j = 0; j < s.size(); j++) {
      if('a' <= s[j] && s[j] <= 'z') change += (s[j]+i)%26 + 'a';
      else change += s[j];
    }

    for(int j = 0; j < change.size(); j++) {
      string tmp = change.substr(j,4);
      if(tmp == "this" || tmp == "that") b = true;
      if(tmp.substr(0,3) == "the") {
	if('a' > tmp[3] || tmp[3] > 'z') {
	  b = true;
	}
      }
    }
    if(b) {
      cout << change << endl;
      break;
    }
  }
}