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<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
    string str,kaku[3]={"the","this","that"};
    while(getline(cin,str)){
        while(1){
            for(int i=0;i<str.size();i++){
                if('A'<=str[i]&&str[i]<='Y')str[i]++;
                else if(str[i]=='Z')str[i]-=25;
                else if('a'<=str[i]&&str[i]<='y')str[i]++;
                else if(str[i]=='z')str[i]-=25;
            }
            for(int i=0;i<3;i++){
                if(str.find(kaku[i])!=string::npos)goto exit;
            }
        }
    exit:
        cout<<str<<endl;
    }
    return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
int main()
{
	int i, j;
	string s, res, tmp;
	while (!cin.eof())
	{
		getline(cin, s);
		res = tmp = s;
		for (i = 0; i < 27; i++)
		{
			res = tmp;
			for (j = 0; j < (int)s.size(); j++)
			{
				if (s[j] != ' ' && s[j] != '.')
				{
					if (s[j] + i > 'z')
						res[j] = 'a' + s[j] + i - 'z' - 1;
					else
						res[j] = s[j] + i;
				}
				else
				{
					res[j] = s[j];
				}
			}
			if (res.find("the") != string::npos || res.find("this") != string::npos || res.find("that") != string::npos)
				break;
		}
		cout << res;
	}
}

C++: #include <iostream>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <stdlib.h>

using namespace std;


int main(){
	string line;

	while(getline(cin, line)){
		int flag = 0;

		for(int i=0 ; i<26 ; i++){
			for(int j=0 ; j<line.size() ; j++){
				if(line[j] != ' ' && line[j] != '.'){
					if(line[j] == 'a'){
						line[j] = 'z' ;
					}else{
						line[j]--;
					}
				}
			}

			for(int k=0 ; k<line.size()-2 ; k++){
				if(line[k] == 't' && line[k+1] == 'h'){
					flag = 1;
					cout << line << endl;
					break;
				}
			}
			if(flag == 1) break;
		}
		//cout << line << endl;
	}
	return 0;
}

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

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

C++: #include <stdio.h>
#include <string.h>
int main(){
  int i,j;
  char s[80];
  int len;
  
  while(gets(s)){
    len=strlen(s);
    
    for(i=0;i<26;i++){
      for(j=0;j<len;j++){
	if(s[j]!=' ' && s[j]!='.'){
	  if(s[j]=='z')s[j]='a';
	  else s[j]++;
	}
      }
      for(j=0;j<len-4;j++){
	if(s[j]=='t' && s[j+1]=='h' && s[j+2]=='e'){printf("%s\n",s);return 0;}
	if(s[j]=='t' && s[j+1]=='h' && s[j+2]=='a' && s[j+3]=='t'){printf("%s\n",s);return 0;}
	if(s[j]=='t' && s[j+1]=='h' && s[j+2]=='i' && s[j+3]=='s'){printf("%s\n",s);return 0;}
      }
      if(s[j]=='t' && s[j+1]=='h' && s[j+2]=='e'){printf("%s\n",s);return 0;}
    }
  }
  memset(s,'\0',sizeof(s));
  return 0;
}

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

static char *words[] = {
  "the",
  "this",
  "that"
};

int main(void)
{
  char cipher[80];
  while(scanf("%[^\n]%*c", cipher) != EOF){

    int i,j,k,l;
    for(i=0; i<26; ++i){

      for(j=0; j<strlen(cipher); ++j){
        if('a'<=cipher[j] && cipher[j]<='z'){
          cipher[j] = (cipher[j]-'a'+1)%26+'a';
        }
      }
      
      int hit = 0;
      for(j=0; !hit && j<(sizeof words/sizeof words[0]); ++j){
        for(k=0; !hit && k+strlen(words[j])<=strlen(cipher); ++k){
          for(l=0; l<strlen(words[j]); ++l){
            if(cipher[k+l]==words[j][l]){
              hit = 1;
            }else{
              hit = 0;
              break;
            }
          }
        }
      }

      if(hit){
        printf("%s\n", cipher);
        break;
      }
    }
  }

  return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <regex>
#include <cctype>
using namespace std;

vector<string> v;

vector<string> split(string&& s, regex&& pattern) {
    sregex_token_iterator first(s.begin(), s.end(), pattern, -1);
    sregex_token_iterator last;
    return(vector<string>(first, last));
}

bool cheser() {
    for(int r = 1; r <= 50; r++) {
        bool found = false;
        for(int c = 0; c < v.size(); c++) {
            for(int k = 0; k < v[c].length(); k++) {
                if(!isalpha(v[c][k])) continue;
                int now = v[c][k] - 'a';
                now = (now+1)%26;
                v[c][k] = 'a' + now;
            }
            if(v[c] == "the" || v[c] == "this" || v[c] == "that") found = true;
        }
        if(found) return(true);
    }
    return(false);
}

int main(void) {
    string input;
    while(getline(cin, input)) {
        v = split(move(input), regex(" "));
        cheser();
        for(int r = 0; r < v.size(); r++) {
            cout << v[r];
            if(r == v.size() - 1) cout << endl;
            else                  cout << " ";
        }
    }
    
    return(0);
}

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

using namespace std;

void Shift(string *str, int shift, int vec) {
  for (int str_i = 0; str_i < str->size(); str_i++)
    if (!isspace((*str)[str_i]) && (*str)[str_i] != '.')
      (*str)[str_i] += vec * shift;
}

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

int main() { 
  string input_str;

  int shift = 1;
  while (getline(cin, input_str)) {
    while (1) {
      Shift(&input_str, shift, 1);
      if (FindTarget(input_str))
        break;
      Shift(&input_str, shift, -1);
      Shift(&input_str, shift, -1);
      if (FindTarget(input_str))
        break;
      Shift(&input_str, shift, 1);
      shift++;
    }
    cout << input_str << endl;
  }

  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;
      }
      if((str.find("the ", 0) != string::npos && str[0] == 't') || (str.find("this ", 0) != string::npos && str[0] == 't') || (str.find("that ", 0) != string::npos && str[0] == 't') || str.find(" the.", 0) != string::npos || str.find(" this.", 0) != string::npos || str.find(" that.", 0) != string::npos || str.find(" the ", 0) != string::npos || str.find(" this ", 0) != string::npos || str.find(" that ", 0) != string::npos || str.find("\nthe ", 0) != string::npos || str.find("\nthis ", 0) != string::npos || str.find("\nthat ", 0) != string::npos || str.find(" the\n", 0) != string::npos || str.find(" this\n", 0) != string::npos || str.find(" that\n", 0) != string::npos)
      cout << str << endl;	
    }
  }
}