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<string>
#include<iostream>
#include<algorithm>
using namespace std;

int caesar[26][255], x, enkrip[100];
int thiss[] = {'t', 'h', 'i', 's'}, the[] = {'t', 'h', 'e'}, that[] = {'t', 'h', 'a', 't'};
string s;
int main() {
	for(int i = 0; i <= 25; i++) {
		for(char j = 'a'; j <= 'z'; j++) {
			if(j + i > 'z') x = j + i - 26; else x = j + i;
			caesar[i][x] = j;
		}
	}
	while(getline(cin, s)) {
	for(int k = 0; k <= 25; k++) {
		int l = 0, z = 0, zz = 0;
		for(int i = 0, j = s.size(); i != j; i++) {
			if(s[i] <= 'z' && s[i] >= 'a') {
				enkrip[i] = caesar[k][s[i]];
				if(enkrip[i] == thiss[l]) l++;
				if(enkrip[i] == the[z]) z++;
				if(enkrip[i] == that[zz]) zz++;
			} else {enkrip[i] = s[i]; if(l != 4) l = 0; if(z != 3) z = 0;if(zz != 4) zz = 0; }
		}
		if(l == 4 || z == 3 || zz == 4) {
			for(int i = 0, j = s.size(); i != j; i++) {
				printf("%c", enkrip[i]);
			}
			printf("\n");
			break;
		}
	}}
	return 0;
}

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

using namespace std;

int main() { 
  string input_str;

  getline(cin, input_str);

  while (1) {
    for (int str_i = 0; str_i < input_str.size(); str_i++)
      if (!isspace(input_str[str_i]) && input_str[str_i] != '.')
        input_str[str_i]--;
    if (input_str.find("the") != string::npos ||
        input_str.find("this") != string::npos ||
        input_str.find("that") != string::npos)
      break;
  }

  cout << input_str << endl;

  return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
void nstr(string st,int n){
  for(int k =0;k<st.length();k++){
    if(st[k] != ' ' && st[k] != '.'){
      if(st[k]+n > 122){
	st[k] = st[k]+n - 26;
      } else {st[k] = st[k] + n;}
    }
  }
  if(st.find("the") != string::npos ||st.find("this") != string::npos ||st.find("that") != string::npos){
      cout << st << endl;
    }
}

int main(){
  int i = 0,count=0;
  string str;
  string tmp;
  while(getline(cin,str)){
     for(int p=0;p<=25;p++){
       nstr(str,p);
     }
  }
}

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

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

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <string>

#define rep(x,to) for(int x=0;x<to;x++)
#define rep2(x,from,to) for(x=from;x<to;x++)

using namespace std;


int main(void){

string inl;
vector<string> svs;
string ww[3] ={"the","this","that"};
	while(getline(cin,inl)){
		rep(i,26){
			rep(j,inl.size()){
				if(inl[j] >= 'a' && inl[j] <= 'z') inl[j] += 1;
				if(inl[j] > 'z' ) inl[j] -= 26;
				
				}
			if(inl.find(ww[0]) != string::npos 
				|| inl.find(ww[1]) != string::npos
				|| inl.find(ww[2]) != string::npos )  cout << inl << endl;
	//		 cout << i << "::" << inl << endl;

		}
	}
	
	return 0;
}

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

void shift(char *str, int len, int n){
	char t[] = "abcdefghijklmnopqrstuvwxyz";
	char c;
	for(int i=0; i<len; ++i){
		c = *(str + i);
		if(c >= 'a' && c <= 'z'){
			str[i] = t[(c-'a'+n)%26];
		}
	}
}

int main(void){
	char input[81];
	char copy[81];
	char *token;
	int len = 0;
	int n = 0;

	while(fgets(input, 80, stdin) != NULL){
		n = -1;
		strcpy(copy, input);

		token = strtok(copy, " .\n");
		while(token != NULL && n == -1){
			len = strlen(token);
			if(len == 4){
				for(int i=0;i<26; ++i){
					shift(token, 4, 1);
					if(strcmp(token, "this")==0 ||
						strcmp(token, "that")==0){
						n = i + 1;
						break;
					}
				}
			}else if(len ==3){
				for(int i=0;i<26; ++i){
					shift(token, 3, 1);
					if(strcmp(token, "the")==0){
						n = i + 1;
						break;
					}
				}
			}
			token = strtok(copy, " .\n");
		}
		shift(input, strlen(input), n);
		puts(input);
	}
	return 0;
}

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

using namespace std;

int main()
{
  string stro, str;
  while(getline(cin, stro)){
    for(int i = 1; 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 <iostream>
#include <string>

using namespace std;

int main()
{
  auto const rot = []( string s, int g )
    {
      for( char& c : s )
        if ( c >= 'a' && c <= 'z' )
          c = (c - 'a' + g) % 26 + 'a';
      return s;
    };

  string s;
  while( getline( cin, s ) ) {
    for( int g=0; g<26; ++g ) {
      auto const& t = rot( s, g );
      if ( t.find( "the" ) != string::npos
           || t.find( "this" ) != string::npos
           || t.find( "that" ) != string::npos
           ) {
        cout << t << endl;
        break;
      }
    }
  }
}