Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func cipher(text string, direction int, int_shift int) string {
	shift, offset := rune(int_shift), rune(26)
	runes := []rune(text)
	for index, char := range runes {
		switch direction {
		case 1:
			if char >= 'a' && char <= 'z'-shift || char >= 'A' && char <= 'Z'-shift {
				char = char + shift
			} else if char > 'z'-shift && char <= 'z' || char > 'Z'-shift && char <= 'Z' {
				char = char + shift - offset
			}
		case -1:
			if char >= 'a'+shift && char <= 'z' || char >= 'A'+shift && char <= 'Z' {
				char = char - shift
			} else if char >= 'a' && char < 'a'+shift || char >= 'A' && char < 'A'+shift {
				char = char - shift + offset
			}
		}
		runes[index] = char
	}
	return string(runes)
}

func main() {
	for {
		infos := strings.Split(nextString(), " ")
		plain := make([]string, len(infos))
		if reflect.DeepEqual(infos, []string{}) {
			break
		}
		fmt.Println(infos)
		Decryption:
			for i := 0; i < 26; i++ {
				for j := range infos {
					plain[j] = cipher(infos[j], 1, i)
				}
				for j := range plain {
					if plain[j] == "this" || plain[j] == "that" || plain[j] == "the" {
						break Decryption
					}
				}
			}
			fmt.Println(strings.Join(plain, " "))
	}
}

C++: #include <iostream>
#include <string>
using namespace std;
int getShiftVal(string& line){
	int s = line.size();
	string::size_type ps = 0, pe = 0;
	while (true){
		while (ps < s && line[ps] == ' ') ++ps;
		pe = ps;
		while (pe < s && line[pe] != ' ') ++pe;
		if (ps == s || pe == s)
			break;
		int len = pe - ps;
		if (3 == len){
			if (line[ps] == line[ps + 1] + 12 && line[ps] == line[ps + 2] + 15){
				return int('t' - char(line[ps]));
			}
		}
		else if (4 == len){
			if (line[ps] == line[ps + 1] + 12 && line[ps] == line[ps + 2] + 11 && line[ps] == line[ps + 3] + 1){
				return int('t' - char(line[ps]));
			}
			else if (line[ps] == line[ps + 1] + 12 && line[ps] == line[ps + 2] + 19 && line[ps] == line[ps + 3]){
				return int('t' - char(line[ps]));
			}
		}
		ps = pe;
	}
	return -1;
}

int main()
{
	string line;
	std::getline(cin, line);
	int s = line.size();
	int v = getShiftVal(line);
	for (int i = 0; i < s; ++i){
		char c = line[i];
		if (c == ' ' || c == '.' || c == '\n') cout << c;
		else cout << char(c + v);
	}
	cout << "\n";
	return 0;
}

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

using namespace std;

#define FOR(i, j, k) for(int i = j; i < k; ++i)
#define rep(i, j) FOR(i, 0, j)
#define repr(i, j) for(int i = j; i >= 0; --i)
#define INF (1 << 30)
#define MOD 1e9 + 7

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;

int main() {
	string s;
	string ans;
	bool flag = false;
	int key = 1;
	while(cin >> s) ans += s + " ";
	ans.erase(ans.size());
	while(1) {
		rep(i, ans.size()) {
			if(97 <= ans[i] && ans[i] <= 122) {
				int number = (ans[i] - 'a' + key) % 26;
				ans[i] = 'a' + number;
			}
		}
		string tmp;
		rep(i, ans.size()) {
			if(97 <= ans[i] && ans[i] <= 122) tmp += ans[i];
			else if(ans[i] == ' ') {
				if(tmp == "this" || tmp == "the" || tmp == "that") flag = true;
				else tmp.erase(tmp.begin(), tmp.end());
			}
		}
		if(flag) break;
	}
	cout << ans << endl;
	return 0;
}

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

int main(){
  string str;

  while(getline(cin,str)){
    int flg = 0;

    while(true){
      for(int i = 0 ; i < str.length() ; i++){
	string key1 = str.substr(i,3),key2 = str.substr(i,4);
	if(key1 == "the" || key2 == "that" || key2 == "this") flg = 1;
      }

      if(flg) break;
      else{
	for(int j = 0 ; j < str.length() ; j++){
	  if('a' <= str[j] && str[j] <= 'z'){
	    str[j] -= 'a' - 'A';
	    str[j] = (char)('A'+(str[j]-'A'+26+1)%26);
	    str[j] += 'a' - 'A';
	  }
	  else continue;
	}
      }
    }
    cout << str << endl;
  }

  return 0;
}

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

using namespace std;

string line;
int str_len;

bool is_finish() {
  for(int i=0; i<str_len-3; i++) {
    if(line[i] == 't') {
      if(line[i+1] == 'h') {
        if(line[i+2] == 'e') { return true; }
        else if(line[i+2] == 'i' && line[i+3] == 's') { return true; }
        else if(line[i+2] == 'a' && line[i+3] == 't') { return true; }
      }
    }
  }
  return false;
};


int main() {
  while(getline(cin, line)) {
    str_len = line.length();

    for(int j=0; j<26; j++) {
      if(is_finish()) { 
        cout << line << endl;
        break; 
      }

      for(int j=0; j<str_len; j++) {
        if('a' <= line[j] && line[j] < 'z') {
          line[j] += 1;
        }
        else if(line[j] == 'z') {
          line[j] = 'a';
        }
      }
    }
  }
  return 0;
}

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

int main(void){
    char buf[128];
    bool found;
    
    gets(buf);
    for(int i=0; i<26; i++){
        found = false;
        if (strstr(buf, "th")){
            found = (strstr(buf,"the") != NULL);
            found |= (strstr(buf,"this") != NULL);
            found |= (strstr(buf,"that") != NULL);
        }
        if (found) break;
        for (char *p = buf; *p != '\0'; p++){
            if (*p >= 'a' && *p <= 'z'){
                *p = (*p - 'a' + 1) % 26 + 'a';
            }
        }
    }
    printf("%s",buf);
    
    return 0;
}

C++: #include <iostream>
#include <complex>
#include <cmath>
#include <cstdio>
#include <string>
#include <sstream>

using namespace std;

string rotate(string str) {
    for (int i = 0; i < str.size(); i++) {
        if ('a' <= str[i] && str[i] < 'z')str[i]++;
        if (str[i] == 'z')str[i] = 'a';
    }
    return str;
}

int main() {
    string str;
    while(getline(cin, str)) {
        for (int i = 0; i < 26; i++) {
            str = rotate(str);
            string tmp;
            bool flg = false;
            for (int i = 0; i < str.size(); i++) {
                if (str[i] != '.')tmp += str[i];
            }
            stringstream ss(tmp);
            while(ss >> tmp) {
                if (tmp == "the" || tmp == "this" || tmp == "that")flg = true;
                break;
            }
            if (flg) {
                cout << str << endl;
                break;
            }
            if (i == 25)return 1;
        }
    }
    return 0;
}

C++: #include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

string solve(string s)
{
    int n = s.size();
    for(;;){
        for(int i=0; i<n; ++i){
            if('a' <= s[i] && s[i] <= 'z'){
                if(s[i] == 'z')
                    s[i] = 'a';
                else
                    ++ s[i];
            }
        }
        istringstream iss(s);
        string s1;
        while(iss >> s1){
            if(s1 == "the" || s1 == "this" || s1 == "that")
                return s;
        }
    }
}

int main()
{
    for(;;){
        string s;
        getline(cin, s);
        if(s == "")
            return 0;

        cout << solve(s) << endl;
    }
}