Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

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

func cipher(text string, direction int, int_shift int) string {
	shift, offset := rune(int_shift), rune(26)
	runes := []rune(text)
	for index, char := range runes {
		switch direction {
		case 1:
			if char >= 'a' && char <= 'z'-shift || char >= 'A' && char <= 'Z'-shift {
				char = char + shift
			} else if char > 'z'-shift && char <= 'z' || char > 'Z'-shift && char <= 'Z' {
				char = char + shift - offset
			}
		case -1:
			if char >= 'a'+shift && char <= 'z' || char >= 'A'+shift && char <= 'Z' {
				char = char - shift
			} else if char >= 'a' && char < 'a'+shift || char >= 'A' && char < 'A'+shift {
				char = char - shift + offset
			}
		}
		runes[index] = char
	}
	return string(runes)
}

func main() {
	for {
		infos := strings.Split(nextString(), " ")
		plain := make([]string, len(infos))
		if len(infos) == 0 {
			break
		}
		// println(infos)
		Decryption:
			for i := 0; i < 26; i++ {
				for j := range infos {
					plain[j] = cipher(infos[j], 1, i)
				}
				for j := range plain {
					if plain[j] == "this" || plain[j] == "that" || plain[j] == "the" {
						break Decryption
					}
				}
			}
			fmt.Println(strings.Join(plain, " "))
	}
}

C++:  
 #include<iostream>
 #include<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 #include<stack>
 
 using namespace std;
  
 int main()
 {
   string a,b;
   while(getline(cin,a))
   {
     for(int shift=1;shift<26;shift++)
     {
       b="";
       for(int i=0;i<a.length();i++)
       {
         if(a[i]>='a'&&a[i]<='z')
         { 
           if(a[i]+shift>'z') b+=(a[i]+(shift-26));
           else b+=(a[i]+shift);
         }         
         else b+=a[i]; 
       }
       if(b.find("the")!=string::npos||b.find("this")!=string::npos||b.find("that")!=string::npos) break;
       else continue;
     }             
     for(int i=0;i<b.length();i++)
     {
       if(i>=80&&i%80==0) cout<<endl;
       cout<<b[i];        
     }
   }
   //while(1);      
   return 0;    
 }

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

using namespace std;

int main(void)
{
    char Cipher[100],ans[100];
	int i=0,count=0;
	while (cin.getline(Cipher,sizeof(Cipher)))
	{
		memcpy(ans,Cipher,sizeof(Cipher));
		while(1)
		{
			char the[10]={'t','h','e'},ths[10]={'t','h','i','s'},that[10]={'t','h','a','t'};
			char *ans;

			if(count==25)break;
			ans=strstr(Cipher,the);
			if(ans!=NULL)break;
			ans=strstr(Cipher,ths);
			if(ans!=NULL)break;
			ans=strstr(Cipher,that);
			if(ans!=NULL)break;
			
			while(Cipher[i]!='\0')
			{
				if(Cipher[i]==' ')i++;
				if(Cipher[i]=='.')break;
				Cipher[i]=Cipher[i]++;
				if(Cipher[i]=='z') Cipher[i]='a';
				i++;
			}
			count++;
			i=0;
		}
		int number=0,i=0;
		if(count!=25)
		{
			while (Cipher[i]!='\0')
			{
				if(Cipher[i]==' ')i++;
				if(Cipher[i]=='.')break;
				number=(Cipher[i]-'a'+count)%26;
				ans[i]=number+'a';
				i++;
			}
		}
		cout<<Cipher<<endl;
		i=0,count=0;
	}
	return 0;
}

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

#define times(n, i) uptil(0, n, i)
#define upto(f, t, i) for(auto _##i = (t), i = decltype(_##i)(f) poi  i <= _##i poi  i++)
#define uptil(f, t, i) for(auto _##i = (t), i = decltype(_##i)(f) poi  i < _##i poi  i++)
#define downto(f, t, i) for(auto i = (f), _##i = decltype(i)(t) poi  i >= _##i poi  i--)
#define downtil(f, t, i) for(auto i = (f), _##i = decltype(i)(t) poi  i > _##i poi  i--)

#define unless(c) if(!(c))
#define until(c) while(!(c))
#define loop while(true)

#define poi ;
#define poipoi << "\n"

/*#define do {*/
#define end }

#define val const auto
#define var auto

#define fuwafuwa(n, c) dokidoki((n) + (c) - 1, c)
#define dokidoki(n, c) ((n) / (c) * (c))

template<class T> bool read(T& t){
    return cin >> t poi
}
template<class T, class...U> bool read(T& t, U&... u){
    unless(cin >> t) return false poi
    return read(u...) poi
}

int main(){
    char c[100] poi
    while(cin.getline(c, 100)){
        string s = c poi
        loop{
            if(s.substr(0, 4) == "the " || s.substr(0, 5) == "this " || s.substr(0, 5) == "that "){
                cout << s poipoi poi
                goto pyon poi
            }
            times(s.size() - 5, i)
                if(s.substr(i, 5) == " the " || s.substr(i, 4) == " this " || s.substr(i, 4) == " that "){
                    cout << s poipoi poi
                    goto pyon poi
                }
            if(s.substr(s.size() - 4) == " the" || s.substr(s.size() - 5) == " this" || s.substr(s.size() - 5) == " that"){
                cout << s poipoi poi
                goto pyon poi
            }

            for(char& c : s) if('a' <= c && c < 'z') c++poi else if(c == 'z') c = 'a' poi
        }
        pyon:;
    }
    return 0 poi
}

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

using namespace std;

int main()
{
  string stro, str;
  while(getline(cin, stro)){
    for(int i = 0; i < 26; i++){
      str = stro;
      for(int j = 0; j < stro.length(); j++){
	if(str[j] != ' ' && str[j] != '.' && str[j] != '\n')
	  if(str[j] + i > 'z')
	    str[j] += i - 26;
	  else
	    str[j] += i;
      }
      unsigned f_the = str.find("the", 0);
      unsigned f_this = str.find("this", 0);
      unsigned f_that = str.find("that", 0);
      if((f_the != string::npos && f_the == 0 && (str[f_the + 3] == ' ' || str[f_the + 3] == '.' || str[f_the + 3] == '\n')) || (f_this != string::npos && f_this == 0 && (str[f_this + 4] == ' ' || str[f_this + 4] == '.' || str[f_this + 4] == '\n')) || (f_that != string::npos && f_that == 0 && (str[f_that + 4] == ' ' || str[f_that + 4] == '.' || str[f_that + 4] == '\n')))
	cout << str << endl;
      else if((f_the != string::npos && (str[f_the - 1] == ' ' || str[f_the - 1] == '.' || str[f_the - 1] == '\n') && (str[f_the + 3] == ' ' || str[f_the + 3] == '.' || str[f_the + 3] == '\n')) || (f_this != string::npos && (str[f_this - 1] == ' ' || str[f_this - 1] == '.' || str[f_this - 1] == '\n') && (str[f_this + 4] == ' ' || str[f_this + 4] == '.' || str[f_this + 4] == '\n')) || (f_that != string::npos && (str[f_that - 1] == ' ' || str[f_that - 1] == '.' || str[f_that - 1] == '\n') && (str[f_that + 4] == ' ' || str[f_that + 4] == '.' || str[f_that + 4] == '\n')))
	cout << str << endl;	 
    }
  }
}

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

using namespace std;

int main()
{
	string S; int C = 0;

	while (getline(cin, S))
	{
		for (int i = 0; i < 26; i++)
		{
			if (!(S.find("this") == string::npos && S.find("that") == string::npos && S.find("the") == string::npos))
			{
				cout << S << endl;

				goto Exit;
			}

			for (string::size_type j = 0; j < S.size(); j++)
			{
				if (isalpha(static_cast<int>(S[j])))
				{
					if (S[j] == 'z')
					{
						S[j] = 'a';
					}
					else
					{
						S[j]++;
					}
				}
			}
		}

	Exit:;

	}

	return 0;
}