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<string>
#define num 26
using namespace std;

int main(){
	int i;
	string str;
	getline(cin, str);
	string strcp = str;
	string::iterator si;
	for(i=0;i<num;i++){
		if(  strcp.find("this", 0) != string::npos
		  || strcp.find("that", 0) != string::npos
		  || strcp.find("the", 0)  != string::npos){
			break;
		}
		si = strcp.begin();
		while(si != strcp.end()){
			if('a' <= *si && *si <= 'y'){
				*si = *si + char(1);
			}else if(*si == 'z'){
				*si = 'a';
			}
			si++;
		}
	}
	cout << strcp << endl;
	return 0;
}

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

int main(){
    char a[81];
    int size;
    int i,t;
    fgets(a,81,stdin);
    size = strlen(a);
    for(t=0;t<26;t++){
        for(i=0;i<size;i++)if(isalpha(a[i]))a[i] = 'a'+(a[i]+1-'a')%26;
        for(i=0;i<size;i++){
            if(a[i]=='t'&&a[i+1]=='h'){
                if(a[i+2]=='e'||(a[i+2]=='i'&&a[i+3]=='s')||(a[i+2]=='a'&&a[i+3]=='t')){
                    printf("%s",a);
                    return 0;
                }
            }
        }
    }
}

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

using namespace std;

int dist(int a, int b) {
	int d = b-a;
	if (d >= 26)
		return d-26;
	if (d < 0)
		return d+26;
	return d;
}

int main() {
	char s[81];
	while (cin.getline(s, 81)) {
		int len = strlen(s);
		int shift;
		for (int i = 0; i <= len-4; i++) {
			if (dist(s[i],s[i+1]) != dist('t','h'))
				continue;
			if (
					(dist(s[i+1], s[i+2]) == dist('h','a') && dist(s[i+2],s[i+3]) == dist('a','t')) ||
					(dist(s[i+1], s[i+2]) == dist('h','i') && dist(s[i+2],s[i+3]) == dist('i','s')) ||
					dist(s[i+1], s[i+2]) == dist('h','e'))
				shift = dist(s[i],'t');
		}
		if (
				dist(s[len-3],s[len-2]) == dist('t','h') &&
				dist(s[len-2],s[len-1]) == dist('h','e'))
			shift = dist(s[len-3], 't');
		for (int i = 0; i < len; i++) {
			if (isalpha(s[i]))
				s[i] = (s[i]-'a'+shift)%26+'a';
		}
		cout << s << endl;
	}
	return 0;
}

C++: /*0017 written by iPhone*/
#include <iostream>
#include <string>

using namespace std;

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

C++: #include <iostream>
#include <algorithm>
#include<string>
#include<vector>
int main() {
	std::string s;

	while (true) {
		std::getline(std::cin, s);
		if (std::cin.eof()) {
			break;
		}
		std::string a;
		int p = s[0] - 't';
		for (int i = 0; i < s.size(); ++i) {
			if (s[i] != ' ' &&s[i] != '.') {
				if (s[i] - p < 'a') {
					a += 'z' - ('a' - (s[i] - p) - 1);
				}
				else a += s[i] - p;
			}
			else a += s[i];
		}
		std::cout << a << std::endl;
	}	
	return 0;
}

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

int size;
string str;
void change()
{
  for (int i = 0; i < size; i++){
    if ('a' <= str[i] && str[i] <= 'y'){
      str[i]++;
    }
    else if (str[i] == 'z'){
      str[i] = 'a';
    }
  }
}

int main()
{
 // string str;

  getline(cin, str);
  size = str.size();

  for (int i = 0; i < 24; i++){
    change();
    if (str.find("the") != -1 || str.find("this") != -1 || str.find("that") != -1){
      cout << str << endl;
      break;
    }
  }
  return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <ctype.h>
#include <algorithm>
using namespace std;

#define loop(i,a,b) for(int i=(a); i<(int)(b); i++)
#define rep(i,b) loop(i,0,b)
#define all(c) (c).begin(), (c).end()
 
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

int main() {
  string s; 
  while(getline(cin, s)) {
    int slide = 0;
    rep(i, s.size()-4) {
      if(islower(s[i]) == 0) continue;
      rep(j, 26) {
        string sub;
        rep(k, 4) sub += (s[i+k]-'a'+j+52)%26 + 'a';
        if(sub.substr(0,3) == "the") slide = j;
        else if(sub == "this" || sub == "that") slide = j;
      }
      if(slide != 0) break;
    }
    rep(i, s.size()) {
      if(islower(s[i]) != 0)printf("%c", (s[i]-'a'+slide+52)%26 + 'a');
      else cout << s[i];
    }
    cout << endl;
  }
}

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

void split(string &s, vector<string> &v) {
  string tmp;
  for (auto &&ch : s) {
    if (ch == ' ') {
      if (!tmp.empty()) {
        v.push_back(tmp);
        tmp.clear();
      }
    } else {
      tmp += ch;
    }
  }
  if (!tmp.empty()) {
    v.push_back(tmp);
  }
}

char normalize(char &c, int n) {
  if (c == '.')
    return c;
  int t;
  t = (int(c) + n) % 26;
  return (t > 18) ? char(t + 78) : char(t + 104);
}

void print(vector<string> &v) {
  for (auto i = v.begin(), e = v.end(); i != e; i++) {
    if (i == e - 1)
      cout << *i << endl;
    else
      cout << *i << " ";
  }
}

int main() {
  string s;
  while (getline(cin, s)) {
    int n;
    vector<string> v;
    split(s, v);
    for (int i = 0; i < 26; i++) {
      vector<string> ret;
      for (auto &&ss : v) {
        string tmp;
        for (auto &&c : ss) {
          tmp += normalize(c, i);
        }
        ret.push_back(tmp);
      }
      if (find(ret.begin(), ret.end(), "this") != ret.end() ||
          find(ret.begin(), ret.end(), "that") != ret.end() ||
          find(ret.begin(), ret.end(), "the") != ret.end()) {
        print(ret);
        break;
      }
    }
    s.clear();
  }

  return 0;
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <cmath>
#include <stack>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
using namespace std;

int cipher(string s){
    string tmp;
    REP(i, 26){
        //tmp = s;
        REP(j, s.length()){
            s[j]++;
            if (s[j] > 'z') s[j] = 'a';
        }
        if (s == "the" || s == "this" || s == "that") return i+1;
    }
    return -1;
}

string convert(string s, int num){
    string con = s;
    REP(i, s.length()){
        if (s[i] >= 'a' && s[i] <= 'z'){
            if (s[i]+num > 'z') s[i] = 'a' + (s[i] + num - 'z' - 1);
            else s[i] += num;
        }
    }
    return s;
}

int main(){
    string s;
    int num;
    while (getline(cin, s)){
        string word = "";
        REP(i, s.length()){
            if (s[i] < 'a' || s[i] > 'z') {
                num = cipher(word);
                if (num >= 0) break;
                else word = "";
            } else {
                word += s[i];
            }
        }
        cout << convert(s, num) << endl;
    }
}