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 <cstdio>
#include <cstring>
using namespace std;
char The[][26] = { "the","uif","vjg","wkh","xli","ymj","znk","aol","bpm","cqn","dro","esp","ftq","gur","hvs","iwt","jxu","kyv","lzw","max","nby","ocz","pda","qeb","rfc","sgd" };
char This[][26] = { "this","uijt","vjku","wklv","xlmw","ymnx","znoy","aopz","bpqa","cqrb","drsc","estd","ftue","guvf","hvwg","iwxh","jxyi","kyzj","lzak","mabl","nbcm","ocdn","pdeo","qefp","rfgq","sghr" };
char That[][26] = { "that","uibu","vjcv","wkdw","xlex","ymfy","zngz","aoha","bpib","cqjc","drkd","esle","ftmf","gung","hvoh","iwpi","jxqj","kyrk","lzsl","matm","nbun","ocvo","pdwp","qexq","rfyr","sgzs" };
char buf[128], tmp[128];
int main()
{
	while (fgets(buf, 128, stdin)) {
		strcpy(tmp, buf);
		int k = 0;
		bool found = false;
		char* p = strtok(buf, " ");
		while (p) {
			if (!found) for (int i = 0; i < 26; ++i)  {
				if (!strcmp(p, The[i]) || !strcmp(p, This[i]) || !strcmp(p, That[i])) {
					found = true;
					k = i;
					break;
				}
			}
			p = strtok(NULL, " ");
		}
		for (int i = 0; tmp[i]; ++i) {
			if ('a' <= tmp[i] && tmp[i] <= 'z')
				putchar((tmp[i] - 'a' - k + 26) % 26 + 'a');
			else
				putchar(tmp[i]);
		}
	}
	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 continue;
                }
            }
        }
    end:
    cout << str << endl;
    }
        
    return 0;
}

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

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

int p ;
int key ;
char c ;

bool isalpha ( char s ) ;

int main ( )
{
	p = 0 ;
	key = 9999 ;
	while ( true ) {
		int t = scanf ( "%s" , w[p].str ) ;
		if ( t == EOF ) {
			break ;
		}
		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] - 'a' > 26 ) {
							w[i].str[j] -= 26 ;
						}
						else if ( w[i].str[j] - 'a' < 0 ) {
							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>
using namespace std;

bool isSmallAlphabet(char& ch) {
  /* a ~ z(ascii) : 97 ~ 122 */
  if('a' <= ch && ch <= 'z') return true;
  else return false;
}

bool isHit(string& str) {
  if(str.find("the") != str.npos) return true;
  else if(str.find("this") != str.npos) return true;
  else if(str.find("that") != str.npos) return true;
  else return false;
}

/* ????????¶??????????§£??? */
void CaesarCipher(string& _str) {
  
  /* parameter??????????????¢??????????????????????????????????????? */
  for(int parameter = 0; parameter < 26; ++parameter) {
    string str = _str;
    for(int i = 0; i < (int)str.length(); ++i) {
      
      /* ?°?????????¢??????????????????????????? */
      if(isSmallAlphabet(str[i])) {
        str[i] += parameter;
        /* ???????????????????°?????????§???????????£??????*/
        if(!isSmallAlphabet(str[i])) {
          str[i] -= 26;
        }
      }

    }

    /* Find "the" or "this" or "that" */
    if(isHit(str)) {
      cout << str << endl;
    }
  }
}

int main() {
  string str;
  while(getline(cin, str)) {
    CaesarCipher(str);
  }
  return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#include <ctype.h>

#define GETSTR(p)       do{ fgets((p), sizeof(p), stdin); } while(0)
#define CHOMP(p)        do{ char *_q = (p) + strlen(p)-1; if(*_q == '\n') *_q = 0;            } while(0)

int main(void){
    char buf[100];
    GETSTR(buf);
    CHOMP(buf);
    int len = strlen(buf);

    const int nn = 'z' - 'a' + 1;

    while(1){
        for(int i = 0; i < len; i++){
            if(isalpha(buf[i])){
                buf[i] = 'a' + (buf[i] - 'a' + nn + 1) % nn;
            }
        }
        char buf2[100];
        sprintf(buf2, " %s ", buf);
        int l = strlen(buf2);
        for(int i = 0; i < l; i++){
            if(! isalpha(buf2[i])) buf2[i] = ' ';
        }
        if(strstr(buf2, " the ") != NULL) break;
        if(strstr(buf2, " this ") != NULL) break;
        if(strstr(buf2, " that ") != NULL) break;
    }
    puts(buf);

    return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <ctype.h>
#include <algorithm>
using namespace std;

#define loop(i,a,b) for(int i=(a); i<(int)(b); i++)
#define rep(i,b) loop(i,0,b)
#define all(c) (c).begin(), (c).end()
 
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

int main() {
  string s; getline(cin, s);
  int slide = 0;
  rep(i, s.size()-4) {
    if(islower(s[i]) == 0) continue;
    rep(j, 26) {
      string sub;
      rep(k, 4) sub += (s[i+k]-'a'+j+26)%26 + 'a';
      if(sub.substr(0,3) == "the") slide = j;
      else if(sub == "this" || sub == "that") slide = j;
    }
    if(slide != 0) break;
  }
  rep(i, s.size()) {
    if(islower(s[i]) != 0)printf("%c", (s[i]-'a'+slide+26)%26 + 'a');
    else cout << s[i];
  }
  cout << endl;
}

C++: #include<iostream>
#include<cstring>
using namespace std;
int main(){
  char str;
  while(1){
    str = getchar();
    if(str=='.'){
      cout<<str;
      break;
    }
    if(str!=' '){
      str=str-4;
      cout<<str;
    }else{
      cout<<" ";
    }
  }
  cout<<endl;
}