Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

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 scanner.Scan() {
		infos := strings.Split(scanner.Text(), " ")
		plain := make([]string, len(infos))
		// fmt.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 <cstdio>
#include <cstring>
using namespace std;



int main(int argc, const char * argv[])
{
    string word;
    while (getline(cin, word)) {
        int cnt = 0;
        for (char tmp2 = word[0]; tmp2 < 'z'; tmp2++) {
            if (tmp2 == 't') {
                break;
            }
            cnt++;
        }
        cnt = 0;
        for (char tmp2 = word[0]; tmp2 > 'a'; tmp2--) {
            if (tmp2 == 't') {
                break;
            }
            cnt--;
        }
        if (word[1] + cnt == 'h') {
            if (word[2] + cnt == 'e') {
                for (int i = 0; i < word.size()-1; i++) {
                    if (word[i] == '.') {
                
                    }
                    else if (word[i] != ' ') {
                        word[i] += cnt;
                    }
                }
            }
            if (word[2] + cnt == 'i' && word[3] + cnt == 's') {
                for (int i = 0; i < word.size() -1; i++) {
                    if (word[i] == '.') {
                        
                    }
                    else if (word[i] != ' ') {
                        word[i] += cnt;
                    }
                }
            }
            if (word[2] + cnt == 'a' && word[3] + cnt == 't') {
                for (int i = 0; i < word.size()-1; i++) {
                    if (word[i] == '.') {
                        
                    }
                    else if (word[i] != ' ') {
                        word[i] += cnt;
                    }
                }
            }
        }
        cout << word << endl;
    }

    
    return 0;
}

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

using namespace std;

char shift(const char c, int shift) {
  int result = c + shift;
  if (result > 'z') result -= 26;
  return result;
}

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


  return 0;
}

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

void decodeOneChar(string& str) {
    for (int i = 0; i < (int)str.length() - 1; i++) {
        if ('a' <= str[i] && str[i] < 'z') {
            str[i]++;
        } else if (str[i] == 'z') {
            str[i] = 'a';
        }
    }
}

int main() {
    string input;
    getline(cin, input);
    while (input.find("the") == string::npos && input.find("this") == string::npos && input.find("that") == string::npos) {
        decodeOneChar(input);
    }
    cout << input << endl;
}

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

int main(){

	string str;
	while (getline(cin, str)){
		while (true)
		{
			for (int i = 0; i < str.size(); i++)
			{
				if (str[i] == ' ' || str[i] == '.') continue;

				if (str[i] == 'z'){
					str[i] = 'a';
				}
				else {
					str[i]++;
				}
			}

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

	return 0;
}

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

int main()
{
	string s;
	int n;
	while (getline(cin, s))
	{
		n = s.size();
		for (int i = 1; i < 27; i++)
		{
			for (int j = 0; j < n; j++)
			{
				if (s[j] == ' ' || s[j] == '.')
				{
					continue;
				}
				if (s[j] == 'z')
				{
					s[j] = 'a';
					continue;
				}
				s[j] ++;

			}
			

			bool ba = s.find("the") != string::npos;
			bool bb = s.find("this") != string::npos;
			bool bc = s.find("that") != string::npos;
			if (ba || bb || bc)
			{
				cout << s << endl;
			}
			
		}
	}

	return 0;
}

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

int main(void){
    string str;
    
    while(getline(cin,str)){
  
        for(int i = 0 ; i < str.size() ; i++){
            if('a' <= str[i] && str[i] <= 'z') cout << (char)('a'+(str[i]-'a'+26-4)%26);
            else cout << str[i];
        }
        puts("");
    }
    
    return 0;
}

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

struct words {
	char str[82] ;
} w[82] ;

int p ;
int key ;
char c ;

bool isalpha ( char s ) ;

int main ( )
{
	p = 0 ;
	key = 9999 ;
	while ( scanf ( "%s" , w[p].str ) == 1 ) {
		c = getchar ( ) ;
		if ( strlen ( w[p].str ) == 4 && key == 9999 ) {
			if ( w[p].str[0] - w[p].str[1] == 't' - 'h' && w[p].str[1] - w[p].str[2] == 'h' - 'i' && w[p].str[2] - w[p].str[3] == 'i' - 's' ) {
				key = 't' - w[p].str[0] ;
			}
			else if ( w[p].str[0] - w[p].str[1] == 't' - 'h' && w[p].str[1] - w[p].str[2] == 'h' - 'a' && w[p].str[2] - w[p].str[3] == 'a' - 't' ) {
				key = 't' - w[p].str[0] ;
			}
		}
		else if ( strlen ( w[p].str ) == 3 && key == 9999 ) {
			if ( w[p].str[0] - w[p].str[1] == 't' - 'h' && w[p].str[1] - w[p].str[2] == 'h' - 'e' ) {
				key = 't' - w[p].str[0] ;
			}
		}
		p++ ;
		if ( c == '\n' ) {
			for ( int i = 0 ; i < p ; i++ ) {
				for ( int j = 0 ; w[i].str[j] ; j++ ) {
					if ( isalpha ( w[i].str[j] ) ) {
						w[i].str[j] += key ;
						if ( w[i].str[j] > 'z' ) {
							w[i].str[j] -= 26 ;
						}
						else if ( w[i].str[j] < 'a' ) {
							w[i].str[j] += 26 ;
						}
					}
				}
				if ( i != 0 ) {
					printf ( " " ) ;
				}
				printf ( "%s" , w[i].str ) ;
			}
			printf ( "\n" ) ;
			p = 0 ;
			key = 9999 ;
		}
	}
	return 0 ;
}

bool isalpha ( char s )
{
	return ( s >= 'a' && s <= 'z' ) ;
}

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

using namespace std;

int main() {
    string input;
    const int alph_lim = 26;

    while (getline(cin, input, '\n')) {
        for (int i = 0; i < alph_lim; i++) {
            for (int j = 0; j < input.size(); j++){
                if(islower(input[j])) {
                    input[j]++;
                    if (input[j] > 'z') {
                        input[j] -= alph_lim;
                    }
                }
            }

            if (input.find("this") != string::npos
                || input.find("that") != string::npos
                || input.find("ths") != string::npos) {

                cout << input << endl;
                break;
            }
        }
    }
    return 0;
}