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<iostream>
#include<string>
using namespace std;

int main(){
  string str;
  string word[111];
  string com[3]={"the","this","that"};
  int cou=0;
  while(cin >> str){
    word[cou] = str;
    cou++;
  }

  while(1){
    bool flag = false;
    for(int i=0;i<cou;i++){
      for(int j=0;j<word[i].size();j++){
	if(word[i][j] == 'z'){
	  word[i][j] = 'a';
	}
	else if(word[i][j] >= 'a' && word[i][j] <= 'z'){
	  word[i][j]++;
	}
      }
      for(int j=0;j<3;j++){
	if(word[i] == com[j]){
	  flag = true;
	  break;
	}
      }
    }
    if(flag == true){
      break;
    }
  }
  for(int i=0;i<cou;i++){
    cout << word[i];
    if(i == cou-1) cout << endl;
    else cout << " ";
  }
}

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

int main(void){
	char data[100];
	char s1[]="the",
		 s2[]="this",
		 s3[]="that";
	int i,cnt=0;
	char *p;

	while((fgets(data,100,stdin))){
		while(cnt<26){
			p=strstr(data,s1);
			if(p)
				break;
			p=strstr(data,s2);
			if(p)
				break;
			p=strstr(data,s3);
			if(p)
				break;
			for(i=0;i<100;i++){
				if(data[i]=='\0')
					break;
				if('a'<=data[i] && data[i]<='y')
					data[i]++;
				else if('z'==data[i])
					data[i]='a';
			}
			cnt++;
		}
		cnt=0;
		printf("%s",data);
	}

	return 0;
}

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

int attack(string line)
{
    static const string cmp[3] = {"the", "this", "that"};
    istringstream iss(line);

    for (string word; iss >> word;) {
        char first = word[0];
        for (string c: cmp) {
            int i = 1;
            for (; i < c.size() && i < word.size(); i++)
                if ((c[i] - 't') % 26 != (word[i] - first) % 26)
                    break;
            if (i == c.size()) {
                int div = ('t' - first) % 26;
                return (div >= 0) ? div : 26 + div;
            }
        }
    }

    return 0;
}

inline int rotN(int x, int n)
{
    if (isalpha(x))
        return (x - 'a' + n) % 26 + 'a';
    else
        return x;
}

int main()
{
    int rot;
    string line;

    while (getline(cin, line)) {

        rot = attack(line);

        for (auto x : line)
            cout << (char) rotN(x, rot);

        cout << endl;
    }

    return 0;
}

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

using namespace std;

int main()
{
    string s;

    while (getline(cin, s)) {
        while (s.find("the") == s.npos &&
                    s.find("this") == s.npos &&
                    s.find("that") == s.npos) {
            for (int i = 0; i < s.size(); i++) {
                if (s[i] >= 'a' || 'y' <= s[i]) {
                    s[i]++;
                } else {
                    s[i] = 'a';
                }
            }
        }
        cout << s << endl;
    }

    return 0;
}

C++: // clang-format off

#include <bits/stdc++.h>

#define int long long int
#define main signed main()
#define bye return 0
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define each(p, v) for (auto p = (v).begin(); p != (v).end(); p++)
#define all(v) (v).begin(), (v).end()
#define prec(n) fixed << setprecision(n)
#define dump(x) cerr << "(L" << __LINE__ << ") " << #x << " = " << (x) << endl
#define clr(x, a) memset(x, a, sizeof(x))

#define stlice(from, to) substr(from, (to) - (from) + 1)
#define odd(n) ((n) % 2)
#define even(n) (!odd(n))

#define INF 1000000000
#define INFLL 1000000000000000000LL
#define MOD 1000000007
#define PI acos(-1)

#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define vi vector<int>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define pii pair<int, int>

using namespace std;

// clang-format on

string f(string s) {
  rep(i, s.size()) {
    if ('a' <= s[i] && s[i] <= 'z') {
      s[i] = (s[i] - 'a' + 1) % ('z' - 'a') + 'a';
    }
  }
  return s;
}

main {
  string s;
  while (getline(cin, s)) {
    vs w;
    stringstream ss;
    ss << s;
    string x;
    while (ss >> x) {
      w.pb(x);
    }
    if (w.size() == 0) {
      continue;
    }
    for (bool b = false; !b;) {
      rep(i, w.size()) {
        string d = f(w[i]);
        string t[] = {"the", "the.", "this", "this.", "that", "that."};
        rep(i, 6) b |= d == t[i];
        w[i] = d;
      }
    }
    cout << w[0];
    loop(i, 1, w.size()) cout << ' ' << w[i];
    cout << endl;
  }
}

C++: #include <iostream>
#include <algorithm>
#include<string>
#include<vector>
int main() {
	std::string s,a;
	std::getline (std::cin , s);
	int p = s[0] - 't';
	for (int i = 0; i < s.size(); ++i) {
		if (s[i] != ' ' &&s[i]!= '.') {
			a += s[i] - p;
		}
		else a += s[i];
	}
	std::cout << a<< std::endl;
	return 0;
}

C++: #include <iostream>
#include <cstring>
#include <string>
using namespace std;
char exch(char *ch,int m){
	if(*ch+m>'z') return (*ch+m-26);
	else if(*ch+m<'a') return (*ch+m+26);
	else return(*ch+m);
}
int main(){
	string str[81]; int diff; int i=0;int flag=0;
	while(cin >> str[i]){
	if(flag==0) diff='t'-str[i][0];
	if(flag==1) ;
	else if(str[i].size()==3 && exch(&str[i][1],diff)=='h' && exch(&str[i][2],diff)=='e') flag=1;
	else if(str[i].size()==4 && exch(&str[i][1],diff)=='h' && exch(&str[i][2],diff)=='i' && exch(&str[i][3],diff)=='s') flag=1;
	else if(str[i].size()==4 && exch(&str[i][1],diff)=='h' && exch(&str[i][2],diff)=='a' && exch(&str[i][3],diff)=='t') flag=1;
	i++;
	};
	for(int j=0;j<i;j++){
		if(j) cout << ' ' ;
		for(int k=0;k<str[j].size();k++){
			char ch=exch(&str[j][k],diff);
			if(str[j][k]-'a'>=0 && str[j][k]-'z'<=0) cout << ch ;
			else cout << str[j][k] ;
		};
	};
	cout << '\n' ;
}

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

int main(){
  string s;
  for(;getline(cin,s);){
    bool f=0;
    for (;!f;){
      for(int i=0;i<s.size();i++){
        if(s[i]>='a' && s[i]<='z'){
          s[i]--;
          if(s[i]<'a')s[i]='z';
        }
      }
      // cout << s.substr(0,5)<<endl;
      string t[3]={"the","this","that"};
      for(int i=0;!f&&i<3;i++){
        for(int j=0;!f&&j+t[i].size()<s.size();j++){
          if(s.substr(j,t[i].size())==t[i]){
            cout<<s<<endl;
            f=1;
          }
        }
      }
    }
  }
}