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<stdio.h>
#include<string.h>
#include<string>
#include<math.h>
#include<iostream>
#include<algorithm>
using namespace std;

int main ()
{
    int i,j;
    char a[10000];
    while(gets(a)!=NULL)
    {
        int len=strlen(a);
        int x=a[0]-'t';
        for(i=0;i<len;i++)
        {
            if(a[i]>='a' && a[i]<='z')
            printf("%c",a[i]-x);
            else
                printf("%c",a[i]);
        }
        printf("\n");
    }
    return 0;
}

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

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

  getline( cin, buf );
  if( buf[buf.size()-1] == '\n' )
    buf.erase(buf.size()-1);
  if( buf[buf.size()-1] == '\r' )
    buf.erase(buf.size()-1);
  
  str.append(buf);
  str.append(" ");
  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;
  }
  
  str.erase(0,1);
  str.erase(str.size() - 1);
  cout << str << 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] -= 'z';
				}
			}
		}
		cout << str << endl;
	}
	return 0;
}

C++: #include<iostream>

int isThisOrThatOrThe(std::string s){
  int dif=0;
  char cro = s[0];
  while(true){
    if(cro == 't')break;
    cro+=1;
    if(cro > 'z')cro = 'a';
    dif++;
  }
  std::string cpys;
  for(int i=0;i<s.length();i++){
    if(s[i]+dif > (int)'z')cpys += (char)((s[i]+dif)%123+'a'); 
    else cpys += (char)(s[i] + dif);
  }
  if(cpys == "that" || cpys == "this" || cpys == "the")return dif;
  return -1;
}


int main(){
  std::string s;
  while(getline(std::cin,s,'\n')){
    
    bool piri = false;
    int st=0,dif = -12;
    for(int i=0;i<=s.length();i++){
      if(s[i] == ' ' || i == s.length() || s[i] == '.'){
	dif = isThisOrThatOrThe(s.substr(st,i-st));
	if(dif != -1){
	  break;
	}
	st = i+1;
      }
    }

    for(int i=0;i<s.length();i++){
      if(s[i] == ' ' || s[i] == '.'){
	std::cout << s[i];
	continue; 
      }
      s[i]+dif > (int)'z'?std::cout << (char)((s[i]+dif)%123+'a'):std::cout << (char)(s[i]+dif);
    }
    std::cout << std::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() - 2; i++)
	{
		if(str[i] == 't' && str[i+1] == 'h') {
			if(str[i+2] == 'e' && (str[i+3] == ' ' || str[i+3] == '\0' || str[i+3] == '.')) {
				flag = true;
				break;
			}
			if(str[i+2] == 'i' && str[i+3] == 's' && (str[i+4] == ' ' || str[i+4] == '\0' || str[i+4] == '.')) {
				flag = true;
				break;
			}
			if(str[i+2] == 's' && str[i+3] == 't' && (str[i+4] == ' ' || str[i+4] == '\0' || str[i+4] == '.')) {
				flag = true;
				break;
			}
		}
	}

	return flag;
}


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

			//cout << str << endl;	//Debug

			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 <string>
using namespace std;
int main()
{
	string str;
	while(getline(cin,str))
	{
		bool flag=false;
		for(int k=0;k<26;k++)
		{
			int i=0;
			for(i=0;i<str.size();i++)
			{
				if(str[i]-'a'<0 || str[i]-'z'>0) continue;
				else { str[i]++; if(str[i]-'z'>0) str[i]-=26; }
			};
			string ptr,qtr;
			for(i=0;i<str.size();i++)
			{
				if(i+4<str.size()) ptr=str.substr(i,4);
				if(i+3<str.size()) qtr=str.substr(i,3);
				if(ptr=="this" || ptr=="that" || qtr=="the") {flag=true; break;}
			};
			if(flag==true) break;
		};
		cout << str << endl ;
	}
}

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

int main(){

  string s;

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


  return 0;
}

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

bool is_valid(const std::string& str) {
	if (str.find("the ") != std::string::npos
		|| str.find("this ") != std::string::npos
		|| str.find("that ") != std::string::npos
		|| str.find(" the ") != std::string::npos
		|| str.find(" this ") != std::string::npos
		|| str.find(" that ") != std::string::npos
		|| str.find(" the") != std::string::npos
		|| str.find(" this") != std::string::npos
		|| str.find(" that") != std::string::npos) {
		return true;		
	}
	return false;
}

int main() {
	std::string str;
	std::getline(std::cin, str);
	
	std::string ans;
	const int limit = 'z' - 'a' + 1;
	for (int i = 0; i < limit; ++i) {
		for (auto c : str) {
			int elem = c + i;
			if (c >= 'a' && c <= 'z') {
				if (elem > 'z') {
					elem = 'a' + elem - ('z' + 1);
				}
				ans.push_back(elem);
			} else {
				ans.push_back(c);
			}
		}
		if (is_valid(ans)) {
			break;
		}
		ans.clear();
	}
	
	std::cout << ans << std::endl;
}

C++: #include <string>
#include <vector>
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <map>
#define INF 100000000
#define rep(i,a) for(int i=0;i<(a);i++)

using namespace std;
typedef long long ll;

char p(char ch){
    char ret=ch+1;
    if(ret==('{'))ret='a';
    return ret;
}


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


    rep(i,30){
        rep(i,s.size()){
            if(s[i]!=' ' && s[i]!='.'){
                s[i]=p(s[i]);
            }
        }

        if( s.find("the",0)!=-1 || s.find("this",0)!=-1 || s.find("that",0)!=-1 ){
            cout<<s<<endl;
            break;
        }
    }
    
    return 0;
    
}

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

using namespace std;

string line;
int str_len;

bool is_finish() {
  for(int i=0; i<str_len-3; i++) {
    if(line[i] == 't') {
      if(line[i+1] == 'h') {
        if(line[i+2] == 'e') { return true; }
        else if(line[i+3] == 'i' && line[i+4] == 's') { return true; }
        else if(line[i+3] == 'a' && line[i+4] == 't') { return true; }
      }
    }
  }
  return false;
};


int main() {
  getline(cin, line);
  str_len = line.length();
  
  for(int j=0; j<26; j++) {
    if(is_finish()) { 
      cout << line << endl;
      break; 
    }

    for(int j=0; j<str_len; j++) {
      if('a' <= line[j] && line[j] < 'z') {
        line[j] += 1;
      }
      else if(line[j] == 'z') {
        line[j] = 'a';
      }
    }
  }
  return 0;
}