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 <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
#include <string>
#include <functional>
#include <array>
#include <stack>
#include <queue>
#include <chrono>
#include <numeric>
#include <memory.h>
#include <map>
#include <math.h>
#include <utility>
#include <set>

#pragma warning(disable:4996)
using namespace std;
#define REP(i,n) for(int i = 0 ; i < n ; ++i)
typedef long long Int;
const double PI = 3.141592653589793238;
const Int INF = 999999999999;
typedef pair<int, int> P;


int main()
{
	string a;

	auto s = string::npos;
	while (getline(cin, a)){
		REP(i, 26){
			for (auto& x : a){
				if (x<'a' || x>'z'){
					continue;
				}
				++x;
				if (x > 'z')x = 'a';
			}
			if (a.find("this") != s || a.find("the") != s || a.find("that") != s)
				cout << a << endl;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int eq(string s,int x){
  for(int k=0;k<80;k++){
    if(s[k]=='t' && s[k+1]=='h'&&s[k+2]=='a' && s[k+3]=='t'){
      return x;
    } else 
      if(s[k]=='t' && s[k+1]=='h'&&s[k+2]=='i' && s[k+3]=='s'){
	return x;
      } else
	if(s[k]=='t' && s[k+1]=='h'&&s[k+2]=='e'){
	  return x;
	}
    
  }
  return 30;
}

int nstr(string st,int n){
  for(int k =0;k <80;k++){
    if(st[k] != ' ' && st[k] != '.'){
      if(st[k]+n > 122){
      st[k] = st[k]+n - 26;
      } else {st[k] = st[k] + n;}
    }
  }
  return eq(st,n);
  

}

int main(){
  int i = 0,count=0;
  string str;
  string tmp;
  for(;i<80;){
    cin >> tmp;
    for(int k=0;k<tmp.size();){
      str[i] = tmp[k];
      k++; i++;
    }
    
    if(tmp[tmp.size()-1] == '.'){
      break;
    }
    str[i] = ' '; i++;
   
  }
  
  for(int p=0;p<=25;p++){
    count = nstr(str,p);
    if(count != 30)
      break;
    count = nstr(str,-p);
  }

  for(int p=0;p<=25;p++){
    count = nstr(str,-p);
    if(count != 30)
      break;
    count = nstr(str,+p);
  }
  
  if(count != 30){
    for(int k = 0;k < i;k++)
    cout << str[k];
    cout << endl;
  }
  
}

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

using namespace std;

int main()
{
	string S[80]; int C = 0;

	while (getline(cin, S[C]))
	{
		C++;
	}

	for (int i = 0; i < 26; i++)
	{
		for (int c = 0; c < C; c++)
		{
			if (!(S[c].find("this") == S[c].npos && S[c].find("that") == S[c].npos && S[c].find("the") == S[c].npos))
			{
				for (int j = 0; j < C; j++) { cout << S[c]; goto Exit; }
			}

			for (string::size_type j = 0; j < S[c].size(); j++)
			{
				if (isalpha(static_cast<int>(S[c][j])))
				{
					if (S[c][j] == 'z')
					{
						S[c][j] = 'a';
					}
					else
					{
						S[c][j]++;
					}
				}
			}
		}
	}

Exit:;

	return 0;
}

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

int main(){
	char s[100];

	int count = 0;

	gets(s);

	int diff;
	int flag = false;
	//一番最初に｛the,that,this｝がある場合
	diff = s[0] - 't';
	if ((s[1] - diff) == 'h'){
		//printf("%c\n", s[j+1] - diff);
		if ((s[2] - diff) == 'e'){
			//printf("%c\n", s[j + 2] - diff);
			if (s[3] == ' '){
				flag = true;
			}
		}
		else if ((s[2] - diff) == 'a'){
			//printf("%c\n", s[j + 2] - diff);
			if ((s[3] - diff) == 't'){
				//printf("%c\n", s[j + 3] - diff);
				if (s[4] == ' '){
					flag = true;
				}
			}
		}
		else if ((s[2] - diff) == 'i'){
			//printf("%c\n", s[j + 2] - diff);
			if ((s[3] - diff) == 's'){
				//printf("%c\n", s[j + 3] - diff);
				if (s[4] == ' '){
					flag = true;
				}
			}
		}
	}
	
	if (!flag){
		//一番以降に｛the,that,this｝がある場合
		for (int j = 1; j < strlen(s); j++){
			if ((s[j]) == ' '){
				diff = s[j + 1] - 't';
				if ((s[j + 1] - diff) == 't'){
					//printf("diff:%d\n", diff);
					if ((s[j + 2] - diff) == 'h'){
						//printf("%c\n", s[j+1] - diff);
						if ((s[j + 3] - diff) == 'e'){
							//printf("%c\n", s[j + 2] - diff);
							if (s[j + 4] == ' '){
								break;
							}
						}
						else if ((s[j + 3] - diff) == 'a'){
							//printf("%c\n", s[j + 2] - diff);
							if ((s[j + 4] - diff) == 't'){
								//printf("%c\n", s[j + 3] - diff);
								if (s[j + 5] == ' '){
									break;
								}
							}
						}
						else if ((s[j + 3] - diff) == 'i'){
							//printf("%c\n", s[j + 2] - diff);
							if ((s[j + 4] - diff) == 's'){
								//printf("%c\n", s[j + 3] - diff);
								if (s[j + 5] == ' '){
									break;
								}
							}
						}

					}
				}
			}
		}
	}
	//printf("diff:%d\n",diff);
	for (int i = 0;i < strlen(s);i++){
		if (s[i] == ' ' || s[i] == '.')continue;
		s[i] -= diff;
	}

	printf("%s",s);

	return 0;
}

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

using namespace std;


int main(){

	string line;

	while(getline(cin, line)){

		string str[80], ans[80];
		int count = 0;
		int flag = 0;
		int slide;

		string temp;
		for(int i=0 ; i<line.size()-1 ; i++){
			temp += line[i];
		}
		line = temp;

		//???????????????????????¨???????´?
		for(int i=0 ; i<line.size() ; i++){
			if(line[i] == ' '){
				count++;
			}else{
				str[count] += line[i];
				ans[count] = str[count];
			}
		}
		count++;


		for(int i=1 ; i<=26 ; i++){
			for(int j=0 ; j<count ; j++){
				for(int k=0 ; k<str[j].size() ; k++){
					if(str[j][k] != '.'){
						str[j][k]++;
						if(str[j][k] > 'z'){
							str[j][k] = str[j][k] - 'z' + 'a' -1;
						}
					}
				}

				if(str[j] == "this" || str[j] == "the" || str[j] == "that"
						|| str[j] == "this." || str[j] == "the." ||str[j] == "that."){
					flag = 1;
					slide = i;
					break;
				}
			}
			if(flag == 1)break;
		}

		for(int i=0 ; i<count ; i++){
			for(int j=0 ; j<ans[i].size() ; j++){
				if(ans[i][j] != '.'){
					if((ans[i][j] + slide) > 'z' ){
						ans[i][j] = ans[i][j] - 'z' + 'a' + slide -1;
					}else{
						ans[i][j] = ans[i][j] + slide ;
					}
				}
			}
		}

		for(int i=0 ; i<count ; i++){
			cout << ans[i] << ' ';
		}
		cout << ans[count] << endl;

	}
	return 0;
}

C++: #include<stdio.h>
#include<iostream>
#include<list>
#include<map>
#include<vector>
#include<algorithm>
#include<string.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << x << endl;
using namespace std;

int main(){
    string s;
    int i, j;

    while( getline(cin, s) ){
        while(s.find("the") == s.npos && s.find("this") == s.npos && s.find("that") == s.npos){
            for(i = 0; s[i]; i++){
                if(s[i] >= 'a' && s[i] <= 'z')
                    s[i]++;
                if(s[i] == 'z' + 1){
                    s[i] = 'a';
                }
            }
        }
        cout << s << endl;
    }
}