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<algorithm>
#include<cstdio>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(i=0;i<n;i++)
#define loop(i,a,n) for(i=a;i<n;i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

typedef vector<int> vi;
typedef pair<int,int> pii;

int main(void) {
  int i,j,k;
  string s;
  char ans[6][10]={"the","the.","this","this.","that","that."};
  while(getline(cin,s)){
    int n=0;
    rep(i,s.size())if(s[i]==' ')n++;
    n++;
    vector<string> word(n);
    i=0;
    rep(j,n){
      while(s[i]!=' '&&s[i]!='\0')
	word[j].push_back(s[i]),i++;
      i++;
    }
    rep(k,26){
      bool c=false;
      rep(i,n)rep(j,word[i].size())
	if(word[i][j]=='z')word[i][j]='a';
	else if(word[i][j]<='z' && word[i][j]>='a')
	  word[i][j]=word[i][j]+1;
      rep(i,n)rep(j,6)
	if(word[i]==ans[j]){
	  c=true;
	}
      if(c){
	rep(i,n){
	  if(i)cout<<" ";
	  cout<<word[i];
	}
	cout<<endl;
	break;
      }
    }
  }
}

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' + 'a';
				}
			}
		}
		cout << str << endl;
	}
	return 0;
}

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

int main() {
  string str,s,newstr;
  int key,word;
  vector<string> seq;
  char decode[4],ans;
  while(getline(cin,str)) {
    seq.clear();
    stringstream ss;
    ss << str;
    while(ss >> s) {
      seq.push_back(s);
    }
    ss.str("");
    ss.clear(stringstream::goodbit);

    word = seq.size();
    key = 100;

    for(int i=0;i<word;i++) {
      if(seq[i].size() == 4) {// ??that.
	decode[0] = *seq[i].substr(0,1).c_str();
	decode[1] = *seq[i].substr(1,1).c_str();
	decode[2] = *seq[i].substr(2,1).c_str();
	decode[3] = *seq[i].substr(3,1).c_str();

	for(int j=1;j<27;j++) {
	  for(int k=0;k<4;k++) {
	    decode[k] -= 97; //a-z 0-25
	    decode[k] ++;//1-26
	    decode[k] %= 26;//0-25
	    decode[k] += 97;//97-122
	  }
	  if(decode[0] == 't' && decode[1] == 'h' && decode[2] == 'i' && decode[3] == 's') {
	    key = j;
	    break;
	  }
	  if(decode[0] == 't' && decode[1] == 'h' && decode[2] == 'a' && decode[3] == 't') {
	    key = j;
	    break;
	  }
	}
      }
      if(key!=100) break;
    }

    for(int i=0;i<word;i++) {
      for(int j=0;j<seq[i].size();j++) {
	ans = *seq[i].substr(j,1).c_str();
	if(ans <= 'z' && 'a' <= ans){
	  ans -= 97;
	  ans += key;
	  ans %= 26;
	  ans += 97;
	}
	cout << ans;
      }
      if(i==word-1) {
	break;
      }
      cout << " ";
      
    }
    cout << endl;
  }
}

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

char buf[1000];
string enc, ans;

string decrypt(string s, int k) {
  string ret = "";
  for (int i=0; i<s.size(); i++) {
    char c = s[i];
    if ('a' <= c && c <= 'z') {
      ret += ('a' + ((c-'a')+k)%26);
    } else {
      ret += c;
    }
  }
  return ret;
}

int main() {
  while (1) {
    if (fgets(buf, 100, stdin) == NULL) break;
    enc = buf;
    for (int i=1;i<26;i++) {
      ans = decrypt(enc, i);
      if (ans.find("the") != string::npos) break;
      if (ans.find("this") != string::npos) break;
      if (ans.find("that") != string::npos) break;
    }

    printf("%s", ans.c_str());
  }
}

C++: #include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
int main(){

    char a[1000];
    while(scanf("%[^\n]",a) != EOF){
        bool flg = 0;
        for(int i = 1; i < 26; i++){
            unsigned char ans[1000] = {0};
            for(int j = 0; j < strlen(a); j++){
                if(a[j] == ' ' || a[j] == '.') ans[j] = a[j];
                else ans[j] = a[j] + i;
                if(ans[j] > 'z') ans[j] -= 26;
            }
            for(int j = 0; j < strlen(a); j++){
                if(ans[j] == 't' && ans[j+1] == 'h'){
                    if(ans[j+2] == 'e' && ans[j+3] == ' ')flg = 1;
                    if(ans[j+2] == 'i' && ans[j+3] == 's' && ans[j+4] == ' ')flg = 1;
                    if(ans[j+2] == 'a' && ans[j+3] == 't' && ans[j+4] == ' ')flg = 1;
                }
                if(flg){
                    if(j == 0){
                        cout << ans << endl;
                        goto end;
                    }
                    else{
                        if(ans[j-1] == ' '){
                            cout << ans << endl;
                            goto end;
                        }
                    }
                }
            }
        }
        end:;
        fflush(stdin);
    }

    return 0;
}

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

char caesar(int n, char c) {
    int zure = c + n - 'a';
    if (zure < 26) return (char)(c + zure);
    else return (char)('a' + (zure % 26));
}

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

C++: #include<iostream>
using namespace std;
int main()
{
	char key[100] = "";
	
	while (cin.getline(key, sizeof(key))) {

		for (int i = 0; i < sizeof(key); i++)
		{
			//if (key[i] == (int)" ")cout << "space";
			if ((int)key[i] == 0)break;
			if ((int)key[i] <= 122 && (int)key[i] >= 97)
				key[i] = (int)key[i] - 1;
			if (key[i] == 96)key[i] = 122;
		}
		for (int i = 0; i < sizeof(key); i++)
		{
			if ((int)key[i] == 0)continue;
			cout << key[i];
		}
		for (int i = 0; i < sizeof(key); i++)
			key[i] = 0;
	}
	return 0;
}