Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

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 scanner.Scan() {
		infos := strings.Split(scanner.Text(), " ")
		plain := make([]string, len(infos))
		// 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++: /*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;
    }
}

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;
}