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 <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;
    			else 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<stdio.h>
#include<iostream>
#include<math.h>
#include<string>
using namespace std;
int main(){
	
	char s[1000];
	while(cin.getline(s,1000)){
		for(int i=0;s[i]!='\0';i++){
			if(((s[i]-s[i+1]+26)%26=='t'-'h')&&((((s[i+1]-s[i+2]+26)%26=='h'-'i')&&((s[i+2]-s[i+3]+26)%26=='i'-'s'))||((s[i+1]-s[i+2]+26)%26=='h'-'e')||(((s[i+1]-s[i+2]+26)%26=='h'-'a')&&((s[i+2]-s[i+3]+26)%26=='a'-'t')))){
				for(int j=0;s[j]!='\0';j++){
					if((s[j]!=' ')&&(s[j]!='.')&&(s[j]!='\n')){
						putchar((s[j]+'t'-s[i]-'a'+26)%26+'a');
					}else{
						putchar(s[j]);
					}
				}cout<<endl;
				break;
			}
		}
	}
	return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <vector>
#include <string>
#include <algorithm>
#include <sstream>
#include <stdlib.h>

using namespace std;

int main(void){
	
	while( true ) {
		if( cin.eof() ) break;
		string str;
		string ans;
		getline( cin, str );

		for( int i = 0; i < 26; i++ ) {
			string newstr;
			newstr = str;
			for( int j = 0; j < str.length(); j++ ) {
				if( str[j] < 'a' || str[j] > 'z' ) continue;
				else {
					newstr[j] = ( str[j] - 'a' + i ) % 26 + 'a';
				}
			}
			if( newstr.find("the") != string::npos || newstr.find("this") != string::npos || newstr.find("that") != string::npos ) {
				ans = newstr;
				break;
			}
		}
		cout << ans;
	}

	
    return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<memory>
#include<array>
#include<vector>
#include<queue>
#include<list>
#include<stack>
#include<algorithm>
#include<cmath>

using namespace std;

int chipher( string& s )
{
  for ( auto& c : s )
    {
      if ( c >= 'a' && c <= 'y' )
        ++c;
      else if ( c == 'z' )
        c = 'a';
    }
  return 0;
}

int main()
{
  
  string x;

  getline(cin, x);

  for ( int i = 0; i < 26; ++i )
    {
      if ( x.find( "the" ) != string::npos )
        cout << x << endl;
      else if ( x.find( "this" ) != string::npos )
        cout << x << endl;
      else if ( x.find( "that" ) != string::npos )
        cout << x << endl;
      chipher( x );
    }
  
  return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <array>
#include <queue>
#include <deque>
#include <set>
#include <list>
#include <map>
#include <stack>
#include <utility>
#include <algorithm>
#include <numeric>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <climits>
#include <bitset>
#include <random>
#include <functional>
#include <sstream>
#include <iomanip>

using namespace std;

#define rep(i, n) for(int i=0; i<(n); i++)
#define FOR(i, m, n) for(int i=(m);i<(n);i++)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define SORT(x) sort((x).begin(),(x).end())
#define REVE(x) reverse((x).begin(),(x).end())
#define mp make_pair
#define pb push_back
#define F first
#define S second


typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;
typedef long long LL;

string convi(string s, int n) {
	string re;
	rep(i, sz(s)) {
		if (islower(s[i])) {
			int a = (int)(s[i]) + n;
			if (a > 122)a -= (a - 122 + 26 - 1) / 26 * 26;
			re += (char)a;
		}
		else {
			re += s[i];
		}
	}
	return re;
}

VS split(string str, char del) {
	VS re;
	string sub;
	for (char c : str) {
		if (c == del) {
			re.pb(sub);
			sub.clear();
		}
		else {
			sub += c;
		}
	}
	re.pb(sub);
	return re;
}

bool check(string s, string t) {
	string s2, t2;
	rep(i, sz(s)) {
		if (s[i] != '.')s2 += s[i];
	}
	rep(i, sz(t)) {
		if (t[i] != '.')t2 += t[i];
	}
	return s2 == t2;
}
int main() {
	string s;
	while (getline(cin, s)) {
		rep(i, 26) {
			string s2 = convi(s, i);
			VS sub = split(s2, ' ');
			VS ch = { "the","this","that" };
			bool flag = false;
			
			rep(j, sz(sub))rep(k, 3) {
				if (check(sub[j],ch[k]))flag = true;
			}

			if (flag) { cout << s2 << endl; break; }
		}
	}
}
/*
A:65
Z:90
a:97
z:122
*/

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

int main(void)
{
	string s;
	getline(cin, s);
	int diff='t'-s[0];

	for(int i=0; i<s.length(); i++)
	{
		if(s[i]!=' ' && s[i]!='.')
			s[i] += diff;
	}
	cout << s << endl;

	return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>

using namespace std;
typedef long long ll;

int main(){
    int in;
    char S[1000];
    
    for(int i=0;;i++){
        
        in = getchar();
        
        if(in==EOF){
            S[i]='\0';
            break;
        }else{
            S[i]=(char)in;
        }
    }
    
    for(int k=0;;k++){
        
        bool f = false;
        
        for(int i=0;;i++){
            if('a'<=S[i] && S[i]<='y'){
                S[i]++;
            }else if(S[i]=='z'){
                S[i]='a';
            }
            
            if(i>=3 && !('a'<=S[i] && S[i]<='z')){
                if(S[i-3]=='t' && S[i-2]=='h' && S[i-1]=='e')
                    f=true;
            }
            if(i>=4 && !('a'<=S[i] && S[i]<='z')){
                if(S[i-4]=='t' && S[i-3]=='h')
                    if((S[i-2]=='i' && S[i-1]=='s') || (S[i-2]=='a' && S[i-1]=='t'))
                        f=true;
            }
            
            if(S[i]=='\0') break;
        }
        
        if(f) break;
    }
    
    for(int i=0;S[i]!='\0';i++)
        printf("%c",S[i]);
    
    return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
  string str;
  while(getline(cin,str)){
    while(str.find("the")==-1&&str.find("this")==-1&&str.find("that")==-1){
      int i;
      for(i=0;i<str.size();i++){
    if('a'<=str[i]&&str[i]<'z') str[i]++;
    else if(str[i]=='z') str[i]='a';
      }
    }
    cout << str << endl;
  }
  return 0;
}