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 <cstdio>
#include <vector>
#include <list>
#include <algorithm>
#include <cmath>
#include <stack>
#include <set>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define FOR(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define PUSH(n,v) for(int i=0; i<(n); i++) {int j; cin >> j; v.push_back(j);}
#define ALL(v) v.begin(), v.end()

void rot1(string &s) {
    string t = "";
    REP(i,s.size()) {
        if (s[i] >= 'a' && s[i] <= 'z') {
            if (s[i] == 'a') t += "z";
            else t += s[i] - 1;
        }else {
            t += s[i];
        }
    }
    s = t;
}

int main() {
    string s;
    while(getline(cin, s)) {
        while(s.find("the") == string::npos && s.find("this") == string::npos && s.find("that") == string::npos) {
            rot1(s);
        }
        cout << s << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
//#include <regex>
#include <cctype>
#include <string>
#include <utility>
using namespace std;

vector<string> v;
/*
vector<string> split(string&& s, regex&& pattern) {
    sregex_token_iterator first(s.begin(), s.end(), pattern, -1);
    sregex_token_iterator last;
    return(vector<string>(first, last));
}
*/
bool cheser() {
    for(int r = 1; r <= 26; r++) {
        bool found = false;
        for(int c = 0; c < v.size(); c++) {
            for(int k = 0; k < v[c].length(); k++) {
                if(!isalpha(v[c][k])) continue;
                int now = v[c][k] - 'a';
                now = (now+1)%26;
                v[c][k] = 'a' + now;
            }
            if(v[c] == "the" || v[c] == "this" || v[c] == "that") found = true;
        }
        if(found) return(true);
    }
    return(false);
}

int main(void) {
    string input;
    while(getline(cin, input)) {
       // v = split(move(input), regex(" "));
        cheser();
        for(int r = 0; r < v.size(); r++) {
            cout << v[r];
            if(r == v.size() - 1) cout << endl;
            else                  cout << " ";
        }
    }
    
    return(0);
}

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

#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
#define OP(m) cout << m << endl;
typedef long long ll;
typedef unsigned long long ull;

int main()
{
    string text;
    while (getline(cin, text))
    {
        while (text.find("the") == string::npos && text.find("this") == string::npos && text.find("that") == string::npos)
        {
            rep(i, text.size())
            {
                if (text[i] != ' ' && text[i] != '.')
                {
                    if (text[i] != 'z')
                        text[i]++;
                    else
                    {
                        text[i] = 'a';
                    }
                }
            }
        }
        OP(text)
    }
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
vector<string> split(string &s, char delimiter){
  vector<string> res;
  int prev_split_point = 0;
  for (int i = 0; i < s.length(); i++) {
    while(s[i] != delimiter && i < s.length())i++;
    string add = s.substr(prev_split_point, i - prev_split_point);
    if(!add.empty())res.push_back(add);
    prev_split_point = i + 1;
  }
  return res;
}

int main(int argc, char *argv[]){
  char c[26];
  for (int i = 0; i < 26; i++) {
    c[i] = 'a' + i;
  }
  vector<string> vs;
  string s;
  string ans[] = {"this", "that", "the"};
  vector<string> tmp;
  while(getline(cin, s)){
    vs = split(s, ' ');
    int n = vs.size();
    for (int k = 0; k < 26; k++) {
      tmp = vs;
      for (int i = 0; i < vs.size(); i++) {
        for (int j = 0; j < vs[i].length(); j++) {
          if('a' <= tmp[i][j] && tmp[i][j] <= 'z')
            tmp[i][j] = c[(vs[i][j] - 'a' + k) % 25];
        }
      }
      for (int i = 0; i < 3; i++) {
        for (int j = 0; j < tmp.size(); j++) {
          if(tmp[j] == ans[i]){k = 50, i = 10, j = 1000;}
        }
      }
    }
    for (int i = 0; i < tmp.size(); i++) {
      std::cout << tmp[i];
      if(i == tmp.size() - 1)std::cout << std::endl;
      else std::cout << " ";
    }
  }
  return 0;
}

C++: #include<iostream>
#include<string>
#include<cmath>
int main(){std::string s;while(std::getline(std::cin,s)){char b[81],*p,*c;c=b;strcpy(b,s.c_str());int gap=0;do{p=strtok(c," .\n");if(p!=NULL){int l=strlen(p);if(l>=3&&p[0]-p[1]=='t'-'h'){if(l==3){if(p[0]-p[2]=='t'-'e'){gap='t'-p[0];break;}}else if(l==4){if(p[0]-p[2]=='t'-'i'&&p[0]-p[3]=='t'-'s'){gap='t'-p[0];break;}else if(p[0]-p[2]=='t'-'a'&&p[0]-p[3]==0){gap='t'-p[0];break;}}}}c=NULL;}while(p!=NULL);for(std::string::iterator it=s.begin();it!=s.end();++it){if(*it!=' '&&*it!='.'&&*it!='\n'){std::cout<<static_cast<char>(*it+gap);}else{std::cout<<*it;}}}}

C++: #include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
using namespace std;
void caesar(char *s, int n) {
  char c;
  while (c = *s) {
    if (c >= 'a' && c <= 'z') 
      *s = 'a' + (c - 'a' + n) % 26;
    s++;
  }
}
int main() {
  int n;
  char s[81];
  scanf("%[^\n]s", s);
  for (n = 0; n < 26; n++) {
    caesar(s, 1);
    if (strstr(s, "the") || strstr(s, "this") || strstr(s, "that")) {
      cout << s << endl;
      break;
    }
  }
  return 0;
}

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

int main(){
    string s;

    while (getline(cin, s)){
	for (int j = 0; j < 26; j++){
	    for (int i = 0; i < s.size(); i++){
		if ('a' <= s[i] && s[i] <= 'z'){
		    s[i] = (s[i] == 'z')? 'a' : s[i] + 1;
		}
	    }
	    if (s.find("the") != string::npos || s.find("this") != string::npos || s.find("that") != string::npos)
		cout << s << endl;
	}
    }
    return 0;
}

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

using namespace std;

int main(){
  string s;
  while(getline(cin,s)){
    for(int i=0;i<26;i++){
      string ans;
      for(string::iterator it=s.begin();it!=s.end();it++){      
	if(*it==' '||*it=='.'){
	  ans.push_back(*it);
	  continue;
	}
	ans.push_back((char)(((int)*it-0x61+i)%26+0x61));
      }
      if(ans.find("the")!=string::npos||ans.find("this")!=string::npos||ans.find("that")!=string::npos){
	cout<<ans<<endl;
	break;
      }
    }
  }
  return 0;
}