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<stdio.h>
#include<iostream>
#include<math.h>
#include<algorithm>
#include<string>
#define pi 3.14159
using namespace std;

int main() {
	string str;
	int i;
	while(getline(cin, str)) {
		for(i = 0; i < 26; i++) {
			for(int j = 0; j < str.size(); j++) {
				if(str[j] != ' ' && str[j] != '.') {
					if(str[j] != 'a') {
						str[j] -= 1;
					} else str[j] = 'z';
					cout << str <<endl;
				}
			}
			for(int j = 0; j < str.size() - 4; j++) {
				if(str[j] == 't' && str[j + 1] == 'h') {
					cout << str <<endl;
					i = 26;
					break;
				}
			}
			
		}
	}

	return 0;
}

C++: /* 
シーザー暗号文の解読
cout << str[i] + 1;
とすると文字が出力されないので注意。配列を書き換えて文字コードをずらす。
*/

#include <iostream>
#include <cstring>
using namespace std;

int main(void) {
    string str;
    int size;
    int f = string::npos;
    
    while(getline(cin, str)) {
        size = str.size();
        while(str.find("the") == f && str.find("this") == f && str.find("that") == f) {
            for(int i = 0; i < size; ++i) {
                if('a' <= str[i] && str[i] < 'z') {
                    str[i]++;
                } else if(str[i] == 'z') {
                    str[i] = 'a';
                }
            }
        }
        cout << str << endl;
    }
}

C++: #include <iostream>
#include <stdio.h>
#include <string>
#include <string.h>
#include <queue>
#include <cmath>
#include <stack>

#define int64 long long int

using namespace std;

char * caesar(char *);

int main()
{
	int i, c;
	char str[128];
	
	while(1){
		for(i=0; ; i++){
			c = getchar();
			if(c == '\n' || c == EOF) break;
			str[i] = c;
		}
		str[i] = 0;
		cout << caesar(str) << '\n';

		if(c == EOF) break;
	}

	return 0;
}

char * caesar(char *str){
	int len, i;
	len = strlen(str);
	while(1){
		for(i=0; i<len; i++){
			if(str[i] >= 'b' && str[i] <= 'z')
				str[i]--;
			else if(str[i] == 'a')
				str[i] = 'z';
		}
		for(i=0; i<len; i++){
			if(str[i] == 't' && str[i+1] == 'h'){
				if(str[i+2] == 'e' ||
					(str[i+2] == 'i' && str[i+3] == 's') ||
					(str[i+2] == 'a' && str[i+3] == 't'))
					return str;
			}
		}
	}
	return 0;
}

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

typedef unsigned long long ull;
const ull B = 100000007;

using namespace std;

bool contain(string,string);

int main(void){
  string str;
  while(getline(cin,str)){
   
    while(1){
	int fg=0;
      for(int j=0;j<26;j++){
	for(int i=0;i<str.length();i++)
	  if(isalpha(str[i]))str[i] = (str[i]=='z')? 'a' : str[i] + 1;

	if(contain("that",str)||contain("the",str)||contain("this",str)){
	  cout << str << endl;
	  fg=1;
	  break;
	}
      }
      if(fg)break;
    }
  }
  return 0;
}

bool contain(string a,string b){
  int al=a.length(),bl=b.length();
  if(al>bl)return false;

  ull t=1;
  for(int i=0;i<al;i++)t*=B;

  ull ah=0,bh=0;
  for(int i=0;i<al;i++)ah=ah*B+a[i];
  for(int i=0;i<al;i++)bh=bh*B+b[i];

  for(int i=0;i+al<=bl;i++){
    if(ah==bh)return true;
    if(i+al<bl) bh=bh*B+b[i+al]-b[i]*t;
  }
  return false;
}

C++: #include<stdio.h>
#include<string>
#include<stdlib.h>
#include<math.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<numeric>
#include<string.h>
#include<map>
#include<queue>

using namespace std;

typedef pair<int,int> pii;

#define rep(i,j) for(int i=0;i<(j);i++)
#define reps(i,j,k) for(int i=j;i<=k;i++)
#define in(i,j,k) ((i)>=(j)&&(i)<=(k))


int main(){
	char s[81];
	int l;
	while(*gets(s)!='\0'){
		l=strlen(s);
		while(strstr(s,"the")==NULL && strstr(s,"that")==NULL && strstr(s,"this")==NULL){
			rep(i,l){
				if(in(s[i],'a','z')){
					s[i]++;
					if(s[i]>'z')s[i]-=26;
				}
			}
		}
		puts(s);
	}
	return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<memory>
#include<array>
#include<vector>
#include<queue>
#include<list>
#include<stack>
#include<algorithm>
#include<cmath>

using namespace std;

int chipher( string& s )
{
  for ( auto& c : s )
    {
      if ( c >= 'a' && c <= 'y' )
        ++c;
      else if ( c == 'z' )
        c = 'a';
    }
  return 0;
}

int main()
{
  
  string x;

  while( getline(cin, x) )
    {
      for ( int i = 0; i < 26; ++i )
        {
          if ( x.find( "the" ) != string::npos )
            cout << x << endl;
          else if ( x.find( "this" ) != string::npos )
            cout << x << endl;
          else if ( x.find( "that" ) != string::npos )
            cout << x << endl;
          chipher( x );
        }
    }
  
  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++: #define _USE_MATH_DEFINES

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <utility>
#include <vector>
#include <numeric>

using namespace std;

int caesar(string s)
{
	string s0 = "this";
	string s1 = "that";
	string s2 = "the";

	for (int i = 0; i <= 26; i++)
	{
		if (s == s0 || s == s1 || s == s2)
		{
			return i;
		}
		for (int j = 0; j < 4; j++)
		{
			s0.at(j) = s0.at(j)++;
			if (s0.at(j) > 'z')
			{
				s0.at(j) = 'a';
			}
			s1.at(j) = s1.at(j)++;
			if (s1.at(j) > 'z')
			{
				s1.at(j) = 'a';
			}
		}
		for (int j = 0; j < 3; j++)
		{
			s2.at(j) = s2.at(j)++;
			if (s2.at(j) > 'z')
			{
				s2.at(j) = 'a';
			}
		}
	}

	return -1;
}

int main()
{
	string str;
	for (; getline(cin, str);)
	{
		stringstream ss;
		ss << str;

		vector<string> w;
		string s;
		int c = -1;
		for (; ss >> s;)
		{
			w.push_back(s);
			
			if (c == -1)
			{
				c = caesar(s);
			}
		}

		for (int i = 0; i < w.size(); i++)
		{
			for (int j = 0; j < w.at(i).size(); j++)
			{
				if (w.at(i).at(j) != '.')
				{
					char sp = w.at(i).at(j) - c;
					if (sp < 'a')
					{
						int p = 'a' - sp - 1;
						w.at(i).at(j) = 'z' - p;
					}
					else
					{
						w.at(i).at(j) = sp;
					}
				}			
			}

			cout << w.at(i) << (i == w.size() - 1 ? "" : " ");
		}

		cout << endl;
	}
}