Go: package main

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

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 len(infos) == 0 {
			break
		}
		// 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 <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;
}

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