Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	for scanner.Scan() {
		var result string
		line := scanner.Text()
		key := make(map[string]string)

		var i int32
		for ; i < 52; i++ {
			makeKey(key, i)
			result = decode(key, line)

			if strings.Contains(result, "the") {
				break
			} else if strings.Contains(result, "this") {
				break
			} else if strings.Contains(result, "that") {
				break
			}
		}

		fmt.Println(result)
	}
}

func makeKey(key map[string]string, shift int32) {
	for i := 'a'; i <= 'z'; i++ {
		cipher := (i + shift)
		if cipher > 'z' {
			cipher = cipher%'z' + 'a' - 1
		} else if cipher < 'a' {
			cipher = cipher + ('z' - 'a') + 1
		}
		key[string(i)] = string(cipher)
	}
}

func decode(key map[string]string, cipher string) string {
	var result string
	for _, v := range cipher {
		if key[string(v)] != "" {
			result += key[string(v)]
		} else {
			result += string(v)
		}
	}
	return result
}

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

bool NotMatch( const std::string& str )
{
	return str.find("the") == std::string::npos && str.find("this") == std::string::npos && str.find("that") == std::string::npos;
}

int main()
{
	std::string str;
	while( getline(std::cin,str),str!="END OF INPUT" )
	{
		while( NotMatch(str) )
		{
			for( unsigned i=0; i<str.length(); ++i )
			{
				if( str[i]=='.' || str[i]==' ' || str[i]=='\n' )
				{
					continue;
				}

				if( str[i] == 'z' )
				{
					str[i] = 'a';
				}
				else
				{
					--str[i];
				}
			}
		}

		std::cout << str << '\n';
	}
}

C++: 
#include <cstdio>
#include <cstring>
#define N 1000000 + 10
char a[N];
int next[N];
void getNext(int len){
    next[0] = -1;
    int j = -1,i = 0;
    while (i < len) {
        if (j == -1 || a[i] == a[j]) {
            i ++;
            j ++;
            next[i] = j;
        }
        else j = next[j];
    }
}

int main()
{
    while (scanf("%s",a)) {
        if (a[0] == '.') {
            break;
        }
        int len = strlen(a);
        getNext(len);
        if (len % (len - next[len] == 0)) {
            printf("%d\n",len / (len - next[len]));
        }else {
            printf("1\n");
        }
    }
    return 0;
}

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

void coding(){
  string s;

  while(getline(cin, s)){
    bool flag = false;
    
    while(true){

      for(int i=0;i<s.length();i++){
	
	string key1 = s.substr(i,3);
	string key2 = s.substr(i,4);
	if(key1 == "the" || key2 == "this" || key2 == "that"){
	  flag = true;
	}
      }
      
      if(flag){
	break;
      }else{
	
    
	for(int i=0;i<s.length();i++){
	  if(s[i] >= 'a' && s[i] <= 'z'){
	    s[i] -= 'a';
	    s[i] += 1;
	    s[i] = s[i]%('A'-'a');
	    s[i] += 'a';
	  }else{
	    continue;
	  }
	}
      }
    }
    cout << s << endl;
  }
}


int main(){
  coding();
}

C++: #include <bits/stdc++.h>

using namespace std;

bool is_finish(string s)
{
    string str;
    stringstream ss(s);
    while (ss >> str) {
        if (str == "the" ||
            str == "this" ||
            str == "that") return 1;
    }
    return 0;
}

int main()
{
    string s;
    while (getline(cin, s)) {
        s.pop_back();
        for (int i = 0; i < 26; i++) {
            for (char &c: s) {
                if (islower(c)) {
                    c = c + 1;
                    if (c > 'z') c = 'a';
                }
            }
            if (is_finish(s)) {
                break;
            }
        }
        cout << s << "." << endl;
    }
    return 0;
}

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


int main()
{
	string s, line[81];
	int counter = 0;
	getline(std::cin, s);
	s += "\n";

	//入力内容を配列にとる．
	string word = "";
	for (int i = 0; i < (signed)s.length(); i++){
		if (s[i] == ' ' || s[i] == '\n'){
			line[counter++] = word;
			word = "";
		}
		else{
			word += s[i];
		}
	}

	

	//ずらす数を探す
	int slide;
	for (int i = 0; i <= 26; i++){
		for (int j = 0; j < counter; j++){
			string word = "";
			for (int k = 0; k < (signed)line[j].length(); k++){
				if (line[j][k] != '.' && line[j][k] != ' '&& line[j][k] != '\n'){
					word += 'a' + (line[j][k] + i - 'a') % 26;
				}
				else{
					word += line[j][k];
				}
			}
			if (word == "the" || word == "this" || word == "that"){
				slide = i;
				goto jump;
			}

		}
	}

jump:

	//ずらすべき数だけずらす
	for (int i = 0; i < counter; i++){
		for (int j = 0; j <(signed)line[i].length(); j++){
			if (line[i][j] != '.' && line[i][j] != ' '&& line[i][j] != '\n'){
				line[i][j] = 'a' + (line[i][j] + slide - 'a') % 26;
			}
		}
	}

	//出力
	for (int i = 0; i < counter - 1; i++){
		cout << line[i] << " ";
	}
	cout << line[counter - 1] << endl;


	return 0;
}

C++: #include<stdio.h>
#include<string.h>
#include<string>
#include<math.h>
#include<iostream>
#include<algorithm>
using namespace std;

int main ()
{
    int i,j;
    char a[10000];
    while(gets(a)!=NULL)
    {
        int len=strlen(a);
        int x=a[0]-'t';
        for(i=0;i<len;i++)
        {
            if(a[i]>='a' && a[i]<='z')
            printf("%c",a[i]-x);
            else
                printf("%c",a[i]);
        }
        printf("\n");
    }
    return 0;
}

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

int main(void){
  int len, cnt;
  string str(" "), buf;

  getline( cin, buf );
  if( buf[buf.size()-1] == '\n' )
    buf.erase(buf.size()-1);
  if( buf[buf.size()-1] == '\r' )
    buf.erase(buf.size()-1);
  
  str.append(buf);
  str.append(" ");
  len = str.length();
  cnt = 0;

  while(true){
    if( str.find(" the ", 0) != string::npos
	|| str.find(" this ", 0) != string::npos 
	|| str.find(" that ", 0) != string::npos
	)
      break;
    for(int i = 0; i < len; i++){
      if( 'a' <= str[i] && str[i] <= 'z' ){
	str[i]++;
	if(str[i] > 'z')
	  str[i] = 'a';
      }
    }

    cnt++;
    if(cnt > 30)
      break;
  }
  
  str.erase(0,1);
  str.erase(str.size() - 1);
  cout << str << endl;

  return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <string>
using namespace std;
int main() {
	string str;
	while(getline(cin, str)) {
		int n = 't' - str[0];
		for(int i = 0; str[i] != '\0'; i++) {
			if(('a' <= str[i])&&(str[i] <= 'z')) {
				str[i] += n;
				if(str[i] > 'z') {
					str[i] -= 'z';
				}
			}
		}
		cout << str << endl;
	}
	return 0;
}

C++: #include<iostream>

int isThisOrThatOrThe(std::string s){
  int dif=0;
  char cro = s[0];
  while(true){
    if(cro == 't')break;
    cro+=1;
    if(cro > 'z')cro = 'a';
    dif++;
  }
  std::string cpys;
  for(int i=0;i<s.length();i++){
    if(s[i]+dif > (int)'z')cpys += (char)((s[i]+dif)%123+'a'); 
    else cpys += (char)(s[i] + dif);
  }
  if(cpys == "that" || cpys == "this" || cpys == "the")return dif;
  return -1;
}


int main(){
  std::string s;
  while(getline(std::cin,s,'\n')){
    
    bool piri = false;
    int st=0,dif = -12;
    for(int i=0;i<=s.length();i++){
      if(s[i] == ' ' || i == s.length() || s[i] == '.'){
	dif = isThisOrThatOrThe(s.substr(st,i-st));
	if(dif != -1){
	  break;
	}
	st = i+1;
      }
    }

    for(int i=0;i<s.length();i++){
      if(s[i] == ' ' || s[i] == '.'){
	std::cout << s[i];
	continue; 
      }
      s[i]+dif > (int)'z'?std::cout << (char)((s[i]+dif)%123+'a'):std::cout << (char)(s[i]+dif);
    }
    std::cout << std::endl;
  }
  return 0;
}