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>
#include <ctype.h>
using namespace std;

int main(){
    string before;
    while (getline(cin, before)) {
        int swich = 0;
        for (int i = 0;i < 27 ;i++) {
            for (int j = 0; j < before.size(); j++) {
                if (before[j]>'z') {
                    before[j] = 'a';
                }
                else if (isalpha(before[j])) {
                    before[j]++;
                }
            }
            for (int j = 0; j < before.size(); j++) {
                if (before[j]=='t'&& before[j+1]=='h'&& before[j+2]=='e') {
                    if (before[j+3]==' '||before[j+3]=='.') {
                        swich = 1;
                        break;
                    }
                }
                else if (before[j]=='t'&&before[j+1]=='h'&&before[j+2]=='a'&&before[j+3]=='t') {
                    if (before[j+4]==' '||before[j+4]=='.') {
                        swich = 1;
                        break;
                    }
                }
                else if (before[j]=='t'&&before[j+1]=='h'&&before[j+2]=='i'&&before[j+3]=='s') {
                    if (before[j+4]==' '||before[j+4]=='.') {
                        swich = 1;
                        break;
                    }
                }
            }
            if (swich == 1) {
                break;
            }
        }
        cout << before << endl;
    }
    return 0;
}

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

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

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

int main(void){
  string s;
  string a[3] = {"this","the","that"};
  getline(cin,s);
  vector<string> ss;
  string n = "";
  s += " ";
  for(int i = 0  ; i < s.size() ; i ++){
    if(s[i] == ' '){
      ss.push_back(n);
      n = "";
    }else{
      n += s[i];
    }
  }
  bool ans = true;
  for(int i = 0 ; i < ss.size() ; i ++){
      for(int j = 0 ; j < ss[i].size() ; j ++){
	if('a' > ss[i][j] && ss[i][j] < 'z')continue; 
	ss[i][j] ++;
	if(ss[i][j] == 'z' + 1)ss[i][j] = 'a';
      }
      for(int j = 0 ; j < 3 ; j ++){
	if(ss[i] == a[j]) ans = false;
	break;
      }
    }
  while(ans){
    for(int i = 0 ; i < ss.size() ; i ++){
      for(int j = 0 ; j < ss[i].size() ; j ++){
	if('a' > ss[i][j] && ss[i][j] < 'z')continue;
	ss [i][j]++;
	if(ss[i][j] == 'z' + 1)ss[i][j] = 'a';
      }
      for(int j = 0 ; j < 3 ; j ++){
	if(ss[i] == a[j]) ans = false;
	break;
      }
    }
  }
  for(int i = 0 ; i < ss.size() ; i ++){
    cout<<ss[i]<<" "; 
  }
  cout<<endl;
}

C++: #include <iostream>
#include <sstream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
#include <cstdio>
#include <cmath>
using namespace std;

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
#define ALL(a)  (a).begin(),(a).end()
#define REP(i,n) for(int i=0;i<(n);++i)
const double EPS = 1e-10;
const double PI  = acos(-1.0);
#define dump(x) cerr << "  (L" << __LINE__ << ") " << #x << " = " << (x) << endl;
#define dumpv(x) cerr << "  (L" << __LINE__ << ") " << #x << " = "; REP(q,(x).size()) cerr << (x)[q] << " "; cerr << endl;
template<typename T1, typename T2>
ostream& operator<<(ostream& s, const pair<T1, T2>& d) {return s << "(" << d.first << "," << d.second << ")";}

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

C++: #include <iostream>
#include <cstdio>
#include <algorithm>

using namespace std;

int main(){
	
	string c = "                                                                                                                                                       ";
	
	bool checker;
	
	while(true){
		
		getline(cin, c);
		
		if(cin.eof()){
			break;
		}
		
		for(int i = 0; i < 26; i++){
			for(int j = 0; j < 2000; j++){
				if(c[j] == '\0'){
					break;
				}else if(c[j] == 'z'){
					c[j] = 'a';
				}else if(c[j] == ' '){
					c[j] = ' ';
				}else if(c[j] == '.'){
					c[j] = '.';
				}else{
					c[j]++;
				}
			}
			
			checker = false;
			
			for(int j = 0; j < 2000; j++){
				if(c[j] == '\0'){
					break;
				}
				if(c[j] == 't' && c[j + 1] == 'h'){
					if(c[j + 2] == 'e'){
						checker = true;
						break;
					}else if(c[j + 2] == 'i' && c[j + 3] == 's'){
						checker = true;
						break;
					}else if(c[j + 2] == 'a' && c[j + 3] == 't'){
						checker = true;
						break;
					}
				}
			}
			
			if(checker){
				break;
			}
		}
		
		for(int i = 0; i < 2000; i++){
			if(c[i] == '\0'){
				break;
			}
			cout << c[i];
		}
		cout << endl;
	}
	
	return 0;
}

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

using namespace std;

int main() {
	string str;
	string in;
	vector<string> s;
	while (cin >> in) s.push_back(in);
	for (int i=0; i<(int)s.size(); i++) {
		str += s[i];
		if (i<(int)s.size()-1) str += " ";
	}
	
	for (int i=1; i<=26; i++) {
		for (int j=0; j<(int)str.size(); j++) {
			if (str[j] == '.' || str[j] == ' ') continue;
			str[j] = str[j] + i;
			if (str[j] >= 'z') str[j] = 'a' + str[j] - 'z';
		}
		if (str.find("the")!=str.npos || str.find("this")!=str.npos || str.find("that")!=str.npos) break;
	}
	
	cout << str << endl;
	
	return 0;
}

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

int main(void){
	char data[100];
	char s1[]="the",
		 s2[]="this",
		 s3[]="that";
	int i,cnt=0;
	char *p;

	while((fgets(data,100,stdin))){
		while(cnt<=26){
			p=strstr(data,s1);
			if(p)
				break;
			p=strstr(data,s2);
			if(p)
				break;
			p=strstr(data,s3);
			if(p)
				break;
			for(i=0;i<100;i++){
				if(data[i]=='\0')
					break;
				if('a'<=data[i] && data[i]<='y')
					data[i]++;
				if('z'==data[i])
					data[i]='a';
			}
			cnt++;
		}
		cnt=0;
		printf("%s",data);
	}
	return 0;
}