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 <stdio.h>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <stdlib.h>
#include <vector>

using namespace std;


int main(){

	string line;

	while(getline(cin, line)){

		string str[80], ans[80];
		int count = 0;
		int flag = 0;
		int slide;

		string temp;
		for(int i=0 ; i<line.size()-1 ; i++){
			temp += line[i];
		}
		line = temp;

		//???????????????????????¨???????´?
		for(int i=0 ; i<line.size() ; i++){
			if(line[i] == ' '){
				count++;
			}else{
				str[count] += line[i];
				ans[count] = str[count];
			}
		}
		count++;


		for(int i=1 ; i<26 ; i++){
			for(int j=0 ; j<count ; j++){
				for(int k=0 ; k<str[j].size() ; k++){
					if(str[j][k] != '.'){
						str[j][k]++;
						if(str[j][k] > 'z'){
							str[j][k] = str[j][k] - 'z' + 'a' -1;
						}
					}
				}

				if(str[j] == "this" || str[j] == "the" || str[j] == "that"
						|| str[j] == "this." || str[j] == "the." ||str[j] == "that."){
					flag = 1;
					slide = i;
					break;
				}
			}
			if(flag == 1)break;
		}
		
		for(int i=0 ; i<count ; i++){
			for(int j=0 ; j<ans[i].size() ; j++){
				if(ans[i][j] != '.'){
					if((ans[i][j] + slide) > 'z' ){
						ans[i][j] = ans[i][j] - 'z' + 'a' + slide -1;
					}else{
						ans[i][j] = ans[i][j] + slide ;
					}
				}
			}
		}

		for(int i=0 ; i<count ; i++){
			cout << ans[i] << ' ';
		}
		cout << ans[count] << endl;

	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<string>
#include<cstdio>
#include<cstring>
using namespace std;
int main(){
  string str;
  char s[256];
  getline(cin , str);
  int n = str.size();
  int w = 1;
  for(int i=0;i<=n;i++){
    s[i] = str[i];
  }
  while(1){
    
    for(int i=0;i<n;i++){
      if(s[i] != ' ' && s[i] != '.'){
	s[i]++;
	if(s[i]>'z')s[i] = s[i] - 'z' + 'a' - 1;
      }
    }
    if(strstr(s,"the") != NULL)break;
    if(strstr(s,"that") != NULL)break;
    if(strstr(s,"this") != NULL)break;
  }
  printf("%s\n",s);
}

C++: #include <bits/stdc++.h>  
 
using namespace std;
 
#define FOR(i, j, k) for(int i = j; i < k; ++i)
#define rep(i, j) FOR(i, 0, j)
#define repr(i, j) for(int i = j; i >= 0; --i)
#define INF (1 << 30)
#define MOD 1e9 + 7
 
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;

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

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

int main(void){
	char list[26];
	list[0]='a';
	for(int i=1;i<26;i++)
		list[i]=list[i-1]+1;
	string S;
	getline(cin,S);
	for(int i=0;i<26;i++){
		for(string ::iterator it=S.begin() ;it!=S.end();it++)
			if(islower(*it))
				*it=list[(*it-'a'+1)%26];
		if(S.find("this")!=-1||S.find("that")!=-1||S.find("the")!=-1)
			break;
	}
	cout << S <<endl;
	return 0;
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <sstream>      // std::ostringstream
std::vector<std::string> split(const std::string &str, char sep)
{
	std::vector<std::string> v;
	std::stringstream ss(str);
	std::string buffer;
	while (std::getline(ss, buffer, sep)) {
		v.push_back(buffer);
	}
	return v;
}
using namespace std;
int main() {
	string str;
	string w[3] = { "the","this",  "that" };
	getline(cin, str);

	vector<string> v = split(str, ' ');

	int key;
	bool f = false;

	v[v.size() - 1].pop_back();

	for (int i = 0; i < v.size();i++) {
		for (int j = 1; j < 26;j++) {
			string temp;
			for (int k = 0; k < v[i].size();k++) {
				temp += (v[i][k] - 'a' + j) % 26 + 'a';
			}
			for (int k = 0; k < 3;k++) {
				if (temp == w[k]) {
					f = true;
					key = j;
					break;
				}
			}
			if (f)break;
		}
		if (f)break;
	}

	for (int i = 0; i < v.size();i++) {
			for (int k = 0; k < v[i].size();k++) {
				cout << char((v[i][k] - 'a' + key) % 26 + 'a');
			}
			if (i == v.size() - 1) {
				cout << ".";
			}
			else {
				cout << " ";
			}
	}
	cout << endl;
}

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

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

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

using namespace std;

void caesar(char* a)
{
	for (int i=0; i<strlen(buf); i++) {
		if (c==' ' || c== '.') continue;
		else if (c=='z') buf[i] = 'a';
		else buf[i]++;
	}
}

int main()
{
	char buf[81];
	
	for (int k=0; k<20; k++) {
		fgets(buf, 80, stdin);
		int len = strlen(buf);
		for (int i=0; i<26; i++) {
			if ( (strstr(buf, "the") != NULL) || (strstr(buf, "this") != NULL) || (strstr(buf, "that") != NULL) ) {
				cout << buf << endl;
				break;
			}
			caesar(buf);
		}
	}
	
	return 0;
}

C++: 
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <stack>
#include <cctype>
#include <complex>
#include <vector>
#include <algorithm>

using namespace std;


bool solve(){
	
	string s;
	while(getline(cin,s)){
		string str[26];
		int num;
		for(int i=0;i<26;i++){
			str[i] = s;
			for(int j=0;j<str[i].size();j++){
				for(int k=0;k<i;k++){
					if(str[i][j]=='.' || str[i][j]==' '){
						continue;
					}
					if(str[i][j] == 'a'){
						str[i][j] = 'z';
					}
					str[i][j]--; 
				}
			}
			
			for(int j=0;j<str[i].size();j++){
				string str_temp, str_temp2;	
				if(j <= str[i].size()-3){
					str_temp  = str[i].substr(j,3);
				}
				if(j <= str[i].size()-4){
					str_temp2 = str[i].substr(j,4);
				}
				if(str_temp=="the" || str_temp2=="this" || str_temp2=="that"){
					num = i;
				}
			}
		}
		
		
		cout<< str[num]<< endl;
	}		
	
	return true;
}

int main(){
	cout.setf(ios::fixed);
	cout.precision(10);
	solve();

	return 0;
}

C++: #include <iostream>
#include <string>
#define REP(i,n) for(int i = 0; i < (n); ++i)
using namespace std;

string Caesar(string str, int shift){
    string ret="";
    REP(i, str.size()){
        if('a'<=str[i] && str[i]<='z') ret += (str[i] - 'a' + shift) % 26 + 'a';
        else ret+=str[i];
    }
    return ret;
}

int main(){
	string str;
	getline(cin, str, '\n');
	REP(i, 26){
		string fix = Caesar(str, i);
    	if( fix.find( "the", 0 ) != string::npos ||
    		fix.find( "this", 0 ) != string::npos ||
    		fix.find( "that", 0 ) != string::npos ){
			cout<<fix<<endl;
			break;
		}
	}
	return 0;
}