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 <fstream>
#include <algorithm>
#include <vector>
#include <string>
#include <functional>
#include <array>
#include <stack>
#include <queue>
#include <chrono>
#include <numeric>
#include <memory.h>
#include <map>
#include <math.h>
#include <utility>
#include <set>

#pragma warning(disable:4996)
using namespace std;
#define REP(i,n) for(int i = 0 ; i < n ; ++i)
typedef long long Int;
const double PI = 3.141592653589793238;
const Int INF = 999999999999;
typedef pair<int, int> P;

vector<string> aa;

int main()
{
	string a;

	getline(cin, a);
	auto left = a.begin();
	
	while (true){
		auto right = left;
		while (right != a.end() && *right != ' ')++right;

		aa.emplace_back(left,right);
		if (right == a.end())
			break;

		left = right+1;
	}
	

	string c[3] = { "this", "that" , "the"};

	vector<string> nn;
	vector<string> kk;
	for (auto x : aa){
		auto n = x.length();
		if (n == 3){
			kk.push_back(x);
		}
		if (n == 4){
			nn.push_back(x);
		}
	}

	for (auto x : kk){
		auto n1 = x[0] - c[2][0];
		bool f(true);

		for (int i = 1; i < 3; ++i){
			if (n1 != x[i] - c[2][i])
				f = false;
		}

		if (f){
			int i(0);
			for (auto x : aa){
				for (auto y : x){
					if (y == '.'){
						std::cout << y;
						continue;
					}

					int q = y - 'a';
					if (q - n1 < 0){
						q = 26 - n1;
					}
					else
						q -= n1;

					std::cout << (char)(q + 'a');
				}
				if (i < aa.size() - 1)
					std::cout << " ";
				++i;
			}
			std::cout << endl;
			return 0;
		}
	}

	for (auto x : nn){
		auto n1 = x[0] - c[0][0];
		auto n2 = x[0] - c[1][0];
		bool f(true);
		bool f2(true);

		for (int i = 1; i < 4; ++i){
			if (n1 != x[i] - c[0][i])
				f = false;
			if (n2 != x[i] - c[1][i])
				f2 = false;
		}

		if (f){
			int i(0);
			for(auto x : aa){
				for (auto y : x){
					if (y == '.'){
						std::cout << y;
						continue;
					}

					int q = y - 'a';
					if (q - n1 < 0){
						q = 26 - n1;
					}
					else
						q -= n1;

					std::cout << (char)(q + 'a');
				}
				if (i < aa.size()-1)
					std::cout << " ";
				++i;
			}
			std::cout << endl;
			return 0;
		}
		else if (f2){
			int i(0);
			for (auto x : aa){
				for (auto y : x){
					if (y == '.'){
						std::cout << y;
						continue;
					}

					int q = y - 'a';
					if (q - n2 < 0){
						q = 26 - n2;
					}
					else
						q -= n2;

					std::cout << (char)(q + 'a');
				}
				if (i < aa.size() - 1)
					std::cout << " ";
				++i;
			}
			std::cout << endl;
			return 0;
		}

	}
	return 0;
}

C++: #include<stdio.h>
#include<string.h>

int main(void){

	char s[81],word[81];
	int i,j;
	int key=0;


	while(gets(s)!=NULL){


		while(1){
		
			i=0;j=0;
			while(s[i] != '\0'){

				if(s[i] == ' '||s[i] == '\n'||s[i+1] == '\0'){


					if(s[i+1] != '\0'){
						i++;
					}
					else if(s[i] != '.'){
						if(s[i]+key <= 'z')
							word[j] = s[i]+key;
						else
							word[j] = 'a'+(key - ('z'-s[i]));
					}


					if(strcmp(word,"the")==0 || strcmp(word,"this")==0 || strcmp(word,"that")==0){
						goto answer;
					}

					for(j=0;j<81;j++)
						word[j] = NULL;
						
					j=0;

					if(s[i+1] == '\0')
						break;

				}
				else{
				
					if(s[i] != '.'){
						if(s[i]+key <= 'z')
							word[j] = s[i]+key;
						else
							word[j] = 'a'+(key - ('z'-s[i]));

						j++;
					}
					i++;
				
				}
			}

			key++;
			if(key > 'z'-'a')
				key = 0;
		}


		answer:
		for(i=0;i<strlen(s);i++){
			if(s[i]>='a' && s[i] <= 'z'){
				if(s[i]+key < 'z')
					putchar(s[i]+key);
				else
					putchar('a'+(key - ('z'-s[i])));
			}
			else
				putchar(s[i]);

		}
		puts("");
		

	}


	return 0;

}

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

int main(){
    string str;
    
    while(getline(cin,str)){
        int flg = 0;
        
        while(true){
            for(int i = 0 ; i < str.length() ; i++){
                string key1 = str.substr(i,3),key2 = str.substr(i,4);
                if(key1 == "the" || key2 == "that" || key2 == "this") flg = 1;
            }
            
            if(flg) goto end;
            else{
                for(int j = 0 ; j < str.length() ; j++){
                    if('a' <= str[j] && str[j] <= 'z'){
                        str[j] -= 'a' - 'A';
                        str[j] = (char)('A'+(str[j]-'A'+26-1)%26);
                        str[j] += 'a' - 'A';
                    }
                    else str[j] = str[j];
                }
            }
        
        
        }
    }
    end:
    cout << str << endl;
    
    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<bits/stdc++.h>
using namespace std;

int main(int argc, char *argv[]){
  char c[26];
  for (int i = 0; i < 26; i++) {
    c[i] = 'a' + i;
  }
  vector<string> vs;
  string s;
  string ans[] = {"this", "that", "the"};
  vector<string> tmp;
  while(cin >> s)vs.push_back(s);
  vs[vs.size() - 1].pop_back();
  for (int k = 0; k < 26; k++) {
    tmp = vs;
    for (int i = 0; i < vs.size(); i++) {
      for (int j = 0; j < vs[i].length(); j++) {
        tmp[i][j] = c[(vs[i][j] - 'a' + k) % 25];
      }
    }
    for (int i = 0; i < 3; i++) {
      for (int j = 0; j < tmp.size(); j++) {
        if(tmp[j] == ans[i]){k = 50, i = 10, j = 1000;}
      }
    }
  }
  for (int i = 0; i < tmp.size(); i++) {
    std::cout << tmp[i];
    if(i == tmp.size() - 1)std::cout << "." << std::endl;
    else std::cout << " ";
  }
  return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
char a[53]="abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz";
int main(){
    char str[81];
    for(int i=0;i<81;i++)str[i]=0;
    for(int i=0;i<80;i++){
        str[i]=getchar();
        if(str[i]==10)break;
    }
    int len=strlen(str);
    for(int i=0;i<26;i++){
        char cpy[81];
        strncpy(cpy,str,81);

        for(int j=0;j<len;j++){
            if(str[j]==' ' || str[j]=='.')continue;
            cpy[j]=a[cpy[j]-'a'+i];
        }
        bool f=false;
        for(int j=0;j<len-2;j++){
            if(!strncmp(cpy+j,"the",3))f=true;
            if(!strncmp(cpy+j,"this",4))f=true;
            if(!strncmp(cpy+j,"that",4))f=true;
        }
        if(f){
            cout<<cpy<<endl;
            break;
        }
    }
    return 0;


}