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>

using namespace std;

int main(int argc, char const* argv[])
{
	string str;

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

C++: #include <iostream>
#include <string>
#include <vector>
using namespace std;
string caesar(string str,int num){
	string ret;
	char c;
	for(int i=0;i<str.size();i++){
		c=str[i]+(num-26);
		if(c<'a') c+=26;
		ret+=(char)c;
	}
	return ret;
}

char caesarc(char c,int num){
	c+=(num-26);
	if(c<'a') c+=26;
	return c;
}

int main(){
	string str,sts;
	vector<string> ary;
	getline(cin,str);
	str+=" ";
	bool hog[3];
	string tes[3];
	int j;
	for(int i=0;i<26;i++){
		hog[0]=hog[1]=hog[2]=false;
		sts="";
		j=0;
		tes[0]=caesar("this",i);
		tes[1]=caesar("that",i);
		tes[2]=caesar("the",i);
		while(j<str.size()){
			sts="";
			while(str[j]!=' '&&str[j]!='.'){
				sts+=str[j];
				j++;
			}
			for(int k=0;k<3;k++){
				if(tes[k]==sts) hog[k]=true;
			}
			j++;
		}
		if(hog[0]&&hog[1]&&hog[2]){
			for(int k=0;k<str.size()-1;k++){
				if('a'<=str[k]&&str[k]<='z'){
					cout<<caesarc(str[k],26-i);
				}
				else cout<<str[k];
			}
			cout<<endl;
			break;
		}
	}
	return 0;
}

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

char seather(char c, int n) {
  if (c == ' ') return ' ';
  if (c == '.') return '.';

  int nn = c + n;
  if (nn > 122) return char(nn - 122 + 97 - 1);
  return char(nn);
}

string decrypt(string str) {
  for (int i = 0; i < 26; i++) {
    string can = "";
    for (int j = 0; j < str.length(); j++) {
      can += seather(str[j], i);
    }
    if(can.find("the") != string::npos || can.find("this") != string::npos || can.find("that") != string::npos) {
      return can;
    }
  }

  return "could not decrypt" + str;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  string input;
  while(getline(cin, input)) {
    if (input == "") continue;
    cout << decrypt(input) << "\n";
  }

  return 0;
}

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

int main() {
    using namespace std;
    string str;
    getline(cin, str);
    regex pattern(".*(the|this|that).*");
    smatch sm;
    for (int c = 0; c < 'z' - 'a' + 1; ++c) {
        for (size_t i = 0; i < str.size(); ++i) {
            if ('a' <= str[i] && str[i] <= 'z') {
                if (str[i] == 'z') {
                    str[i] = 'a';
                } else {
                    str[i] += 1;
                }
            }
        }
        if (regex_match(str, sm, pattern)) {
            cout << str << endl;
            return 0;
        }
    }
}

C++: #include <iostream>
#include <algorithm>
#include <cctype>
#include <cstdio>
#include <math.h>
#include <map>
#include <queue>
#include <string>
using namespace std;

char ch;
string text;

int main() {
    while(getline(cin,text)){
    	for(int i=0;i<26;i++){
    		for(int j=0;j<text.size();j++){
    			if(text[j]>='a'&&text[j]<='y')text[j]+=1;
    			if(text[j]=='z')text[j]='a';
    		}
    		int p=text.find("the"),q=text.find("this"),r=text.find("that");
    		if(p!=string::npos||q!=string::npos||r!=string::npos){
    			cout<<text<<endl;
    			break;
    		}
    	}
    }
}

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

int cmp(string s){
	if(s.find("is",0)!=string::npos) return 1;
	if(s.find("the",0)!=string::npos) return 1;
	if(s.find("this",0)!=string::npos) return 1;
	return 0;
}

int main() {
	string s;
	getline(cin,s);
	for(int h=0;h<26;h++){
		for(unsigned int i=0;i<s.length();i++){
				if(s[i]==0x2e||s[i]==0x20) continue;
				s[i]+=1;
				if((int)s[i]>0x7a) s[i]=0x61;
		}if(cmp(s)==1) break;
	} cout<<s<<endl;
	return 0;
}

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

#define pb(n) push_back(n)
#define fi first
#define se second
#define np string::npos
#define X real()
#define Y imag()
#define value(x,y,w,h) (x >= 0 && x < w && y >= 0 && y < h)
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define repc(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

typedef long long ll ;
typedef deque<int> di ;
typedef deque<ll> dl ;
typedef map<string,int> dict;
typedef complex<double> comd;
typedef pair<int,int> pii;

constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0};
const int dx[] = {0,-1,0,1};

double CalcDist(comd p1, comd p2){
  return sqrt(pow(p1.X - p2.X,2.0) + pow(p1.Y -p2.Y,2.0));
}

  template <typename T>
void out(deque < T > d)
{
  for(size_t i = 0; i < d.size(); i++)
  {
    debug(d[i]);
  }
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

string Decode(string s, int n){
  string res = s;
  rep(i,s.size()){
    if(s[i] != '.' && s[i] != ' '){
      if(s[i] + n > 'z'){
        res[i] = 'a' + (s[i] + n - 'z')-1;
      }
      else{
        res[i] = s[i] + n;
      }
    }
  }
  return res;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  vector<string> vs;
  while(cin >> s){
    vs.clear();
    vs.pb(s) ;
    if(s[s.size()-1] != '.'){
      while(1){
        cin >> s;
        vs.pb(s) ;
        if(s[s.size()-1] == '.'){
          break;
        }
      }
    }
    int code = 0;
    rep(i,27){
      rep(j,vs.size()){
        if(Decode(vs[j],i) == "this" ||Decode(vs[j],i) == "that" || Decode(vs[j],i) == "the"){
          code = i;
          i = 27;
          j = vs.size();
        }
      }
    }
    rep(i,vs.size()){
      cout << Decode(vs[i],code) ;
      if(i != vs.size()-1){
        cout << " " ;
      }
    }
    cout << endl;
  }
  return 0;
}

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

using namespace std;

int main(){
	
	char A[100] = {};
	
	cin.getline(A, 80);
	
	for(int i=0;i<80;i++) {
	if( A[i] >= 'A' && A[i] < 'Z')
	A[i] += 1;
	
	else if( A[i] >= 'a' && A[i] < 'z')
	A[i] += 1;
	
	else if( A[i] == 'Z' || A[i] == 'z')
	A[i] -= 25;
	
}
	cout << A;
    return 0;
}