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++: #include<iostream>
#include<string>

int main(){
	std::string org_str,str;
	int e=1;
	std::getline(std::cin,org_str);
	while(true){
		str=org_str;
		for(int j=0;j<str.size();j++){
			if(str[j]!=' '&&str[j]!='.'){
				int a=static_cast<int>(str[j]);
				a-=e;
				while(a<(int)'a')a+=26;
				while(a>(int)'z')a-=26;
				str[j]=static_cast<char>(a);
			}
		}
		if(str.find("the")!=-1||str.find("this")!=-1||str.find("that")!=-1)break;
		else e++;
	}
	std::cout<<str<<std::endl;
	return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main() {
	string a = "";
	while (true) {
		int u = 0;
		while (getline(cin, a)) u++;
		if (u == 0) break;
		a += " ";
		string b = "";
		int z = 0, sum = 0;
		int k = a.length();
		for (int i = 0; i <k; i++) {
			if (a[i] == ' ' || a[i] == '.') {
				b = a.substr(z, i - z);
				int t = (int)'t';
				string c = "";
				if (b.length() == 3 || b.length() == 4) {
					c = "";
					int w = t - (int)b[0];
					for (int i = 0; i < b.length(); i++) {
						int d = (char)((int)b[i] + w);
						if (d > 'z')
							d -= 26;
						else if (d < 'a')
							d += 26;
						c += (char)d;
					}
					if (c == "the" || c == "that" || c == "this") {
						sum = w;
						break;
					}
				}
				z = i + 1;
			}
		}
		string f = "";

		for (int i = 0; i < k-1; i++) {
			if (a[i] != ' ' && a[i] != '.' ) {
				int g = (int)a[i] + sum;
				if (g >(int)'z')
					g -= 26;
				else if (g < (int)'a')
					g += 26;
				f += (char)g;
			}
			else {
				f += a[i];
			}
		}
		cout << f << endl;
	}
}

C++: #include<iostream>
#include<iomanip>
#include<algorithm>
#include<bitset>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<functional>
#include<limits>
#include<list>
#include<map>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<queue>
#include<vector>
using namespace std;

#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL

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

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

using namespace std;

string dict = "abcdefghijklmnopqrstuvxwyz";

string decode(string s, int v) {
    string ans = s;
    for(int i = 0; i < (int) s.size(); i++) {
        if(s[i] >= 'a' && s[i] <= 'z') {
            ans[i] =  dict[((s[i] + v) % 26)];
        }
    }
    return ans;
}

int main() {
    string s;

    while(getline(cin, s)) {
        if(s.size <= 1) break;
        for(int i = 1; ; i++) {
            string tmp = decode(s, i);
            if(tmp.find("this") != string::npos && tmp.find("the") != string::npos && tmp.find("that") != string::npos) {
                cout << tmp << endl;
                break;
            }
         }
    }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main() {
	string s;
	while(getline(cin, s)){
		string ans;
		int maxim = 0;
		for(int i = 0; i < 26; ++i){
			for(int j = 0; j < s.size(); ++j){
				if(s[j] == 'a')
					s[j] = 'z';
				else if(s[j] == ' ' || !('a' <= s[j] && s[j] <= 'z'))
					continue;
				else
					s[j]--;
			}
			string t("");
			int cnt = 0;
			for(int j = 0; j < s.size(); ++j){
				if(s[j] == ' '){
					if(t == "the" || t == "this" || t == "that")
						cnt++;
					t = "";
				}
				else{
					t += s[j];
				}
			}
			if(maxim < cnt){
				ans = s;
				maxim = cnt;
			}
		}
		cout << ans << endl;
	}
	return 0;
}

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

char cShiftchar(char ch)
{
    if(isalpha(ch))
    {
        ch++;
        if(ch > 'z') ch = ch - 'z';
    }

    return ch;
}

string sDecode(string str)
{
    string ans;
    while( str.find("the")
            || str.find("this")
            || str.find("that")
         )
        transform(str.begin(), str.end(), str.begin(), cShiftchar);
    return ans;
}

int main()
{
    string str;
    while(getline(cin, str))
    {
        cout << sDecode(str) << endl;
    }
    return EXIT_SUCCESS;
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
#include <vector>
#include <set>

using namespace std;
typedef long long LL;
static const double EPS = 1e-9;

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n) 
void decode(vector<string> &words)
{
  int s=0;
  REP(i,words.size()){
    REP(j,26){
      REP(k,words[i].size()){
        if(words[i][k] >= 'a' && words[i][k] <= 'z' )
        words[i].replace(k, 1, 1,
              'a' + ( words[i][k] + 1 - 'a')%26 );
        
        if(words[i] == "the"||words[i] == "this" || words[i] == "that" ||
           words[i] == "the." || words[i] == "this." || words[i] == "that." )
          s = j;
      }
    }
  }
  REP(i,words.size())
    REP(j,words[i].size())
      if(words[i][j] >= 'a' && words[i][j] <= 'z' )
        words[i].replace(j, 1, 1, 'a' + (words[i][j] + s+1 - 'a')%26 );
}

int main(void){  
  vector<string> words;
  string bf;

  while(true){
    if(!(cin >> bf)) break;
    words.push_back(bf);
    if(bf.find('.') != string::npos){
      decode(words);
      cout << words[0];
      FOR(i,1,words.size())
        cout << " " << words[i];
      cout << endl;
      words.clear();
    }
  }
  return 0;
}