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 <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
int main(){

  //  string x;
  char x[100];
  gets(x);
  //  cin >> x;
  bool is = true;
  if(strlen(x) >= 3){
    for(int i = 0; i < 26 ; i++){
      //the 
      for(int j = 0; j <= strlen(x)-3; j++){
	if(is && x[j] =='t' && x[j+1] == 'h' && x[j+2] == 'e'){
	  is = false;
	  break;
	}
      }
      // this or that
      if(strlen(x) >= 4){
	for(int j = 0; j <= strlen(x)-4; j++){
	  if(is && x[j] =='t' && x[j+1] == 'h' && x[j+2] == 'a' && x[j+3] =='t' ){
	    is = false;
	    break;
	  }
	  if(is && x[j] =='t' && x[j+1] == 'h' && x[j+2] == 'i' && x[j+3] =='s' ){
	    is = false;
	    break;
	  }
	}
      }
      // increment
      if(is == false) break; 
      for(int j = 0; j < strlen(x) ; j++){
	if(x[j] == ' ') x[j] = ' ';
	else if(x[j] == 'z') x[j] = 'a';
	else if(x[j] >= 'a' && x[j] < 'z') x[j]++;
      }
    }
    
    if(is == false)	
      cout << x << endl;
  }
  return 0;
}

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

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

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

void next(string& str)
{
	for(int i=0; i<str.length(); i++)
	{
		if('a'<=str[i] && str[i]<='z')
		{
			str[i] = ((str[i]-'a'+25)%26)+'a';
		}
	}
}

int main()
{
	string str;
	while(getline(cin,str))
	{
		for(int i=0; i<26; ++i,next(str))
		{
			if(-1!=str.find("the") || -1!=str.find("this") || -1!=str.find("that"))
			{
				cout << str << endl;
				break;
			}
		}
	}

	return 0;
}

C++: #define scanf_s scanf
#define gets_s gets
#include <stdio.h>
#include <string>
#include <iostream>
#include <math.h>
using namespace std;
#define MAX 81
#define _MAX 100
#define ABC 26
int main(void)
{
	int n, s = 0, x, y, r = 0, a, b;
	int sum_n[50][3] = { 0 };
	char sum[50][_MAX], str[_MAX], bstr[_MAX], num[11] = { "0123456789" };
	//
	while(gets_s(str)){
		for (int i = 0; str[i] != '\0'; ++i) {
			if (str[i] - 't' == str[i + 1] - 'h') {
				a = str[i] - 't';
				if ((str[i + 2] - a + 'z') % 'z' == 'e') { b = a; break; }
				else if ((str[i + 2] - a + 'z') % 'z' == 'i' + ABC && (str[i + 3] - a + 'z') % 'z' == 's') { b = a; break; }
				else if ((str[i + 2] - a + 'z') % 'z' == 'a' + ABC && (str[i + 3] - a + 'z') % 'z' == 't') { b = a; break; }
			}
		}
		for (int i = 0; str[i] != '\0'; ++i) {
			if ('a' <= str[i] && str[i] <= 'z') {
				printf("%c", (str[i] - a + 'z') % 'z');
			}
			else { printf("%c", str[i]); }
		}
		printf("\n");
	}
}

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

typedef pair<string, string> P;

P next_word(string sentence) {
  if (sentence.empty()) return make_pair(string(""), string(""));
  if (sentence[0] == ' ' || sentence[0] == '.') {
    return make_pair("", sentence.substr(1));
  } else {
    P recur = next_word(sentence.substr(1));
    return make_pair(sentence[0] + recur.first, recur.second);
  }
}

bool acceptable(string sentence) {
  P p = next_word(sentence);

  while (! p.first.empty() ) {
    if (p.first == "this" || p.first == "the" || p.first == "that")
      return true;

    p = next_word(p.second);
  }
  return false;
}

char slip(char c) {
  if (c < 'a' || 'z' < c) return c;
  
  string alphabet = "abcdefghijklmnopqrstuvwxyza";
  int index = (int)(c - 'a');
  return alphabet[index + 1];
}

char slip(char c, int n) {
  for (int i = 0; i < n; i++)
    c = slip(c);

  return c;
}

string slip(string code, int n) {
  string val;
  for (int i = 0, len = code.length(); i < len; i++)
    val += slip(code[i], n);

  return val;
}

string decode(string code) {
  for (int i = 1; i < 27; i++) {
    string sentence = slip(code, i);
    if (acceptable(sentence))
      return sentence;
  }

  return "";
}

int main() {
  string code;
  while ( getline(cin, code) )
    cout << decode(code) << endl;
}

C++: #include<iostream>
#include<string>
#include<cstdio>
using namespace std;
int main() {
	string a = "";
	while (getline(cin, a)) {
		a += " ";
		string b = "";
		int z = 0, sum = 0;
		int k = a.length();
		for (int i = 0; i <k; i++) {
			if (a[i] == ' ' || a[i] == '.' || a[i] == ',') {
				b = a.substr(z, i - z);
				int t = (int)'t';
				string c = "";
				if (b.length() == 3 || b.length() == 4) {
					c = "";
					int w = t - (int)b[0];
					for (int i = 0; i < b.length(); i++) {
						int d = (char)((int)b[i] + w);
						if (d > 'z')
							d -= 26;
						else if (d < 'a')
							d += 26;
						c += (char)d;
					}
					if (c == "the" || c == "that" || c == "this") {
						sum = w;
						break;
					}
				}
				z = i + 1;
			}
		}
		string f = "";

		for (int i = 0; i < k-1; i++) {
			if (a[i] != ' ' && a[i] != '.' && a[i] != ',') {
				int g = (int)a[i] + sum;
				if (g >(int)'z')
					g -= 26;
				else if (g < (int)'a')
					g += 26;
				f += (char)g;
			}
			else {
				f += a[i];
			}
		}
		cout << f << endl;
	}
}

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

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

	return 0;
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
#include <vector>
#include <set>

using namespace std;
typedef long long LL;
static const double EPS = 1e-9;

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n) 
void decode(vector<string> &words)
{
  int s=0;
  REP(i,words.size()){
    REP(j,26){
      REP(k,words[i].size()){
        if(words[i][k] >= 'a' && words[i][k] <= 'z' )
        words[i].replace(k, 1, 1,
              'a' + ( words[i][k] + 1 - 'a')%26 );
        
        if(words[i] == "the"||words[i] == "this" || words[i] == "that" ||
           words[i] == "the." || words[i] == "this." || words[i] == "that." )
          s = j;
      }
    }
  }
  REP(i,words.size())
    REP(j,words[i].size())
      if(words[i][j] >= 'a' && words[i][j] <= 'z' )
        words[i].replace(j, 1, 1, 'a' + (words[i][j] + s+1 - 'a')%26 );
}

int main(void){  
  vector<string> words;
  string bf;

  while(true){
    if(!(cin >> bf)) break;
    words.push_back(bf);
    int c = getchar();
    if(c=='\n'){
      decode(words);
      cout << words[0];
      FOR(i,1,words.size())
        cout << " " << words[i];
      cout << endl;
      words.clear();
    }
  }
  return 0;
}