Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func incrementByte(b byte) byte {
	if b >= 97 && b < 122 {
		return b + 1
	} else if b == 122 {
		return 97
	}
	return b
}

func main() {
	scanner.Split(bufio.ScanLines)

	for {
		line := nextString()
		if len(line) == 0 {
			break
		}
		for i := 0; i <= 26; i++ {
			decoded := []byte{}
			for j := 0; j < len(line); j++ {
				decoded = append(decoded, incrementByte(line[j]))
			}
			line = string(decoded)
			if strings.Contains(line, "the") || strings.Contains(line, "this") || strings.Contains(line, "that") {
				fmt.Println(line)
				break
			}
		}
	}
}

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

int main(){
    string before;
    while (getline(cin, before)) {
        int swich = 0;
        for (int i = 0; ; i++) {
            for (int j = 0; j < before.size(); j++) {
                if (before[j]>'z') {
                    before[j] = 'a';
                }
                else if (isalpha(before[j])) {
                    before[j]++;
                }
            }
            for (int j = 0; j < before.size(); j++) {
                if (before[j]=='t'&& before[j+1]=='h'&& before[j+2]=='e') {
                    swich = 1;
                    break;
                }
                else if (before[j]=='t'&&before[j+1]=='h'&&before[j+2]=='a'&&before[j+3]=='t') {
                    swich = 1;
                    break;
                }
                else if (before[j]=='t'&&before[j+1]=='h'&&before[j+2]=='i'&&before[j+3]=='s') {
                    swich = 1;
                    break;
                }
            }
            if (swich == 1) {
                break;
            }
        }
        cout << before << endl;
    }
    return 0;
}

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

using namespace std;

int main(){
  string t,s;
  while(getline(cin,t)){
    s.append(t);
      }
  for(int i=1;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;
}

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

using namespace std;


int main(){
	string line;

	while(getline(cin, line)){
		int flag;

		for(int i=0 ; i<26 ; i++){
			for(int j=0 ; j<line.size() ; j++){
				if(line[j] != ' ' && line[j] != '.'){
					if((line[j]-1) < 'a'){
						line[j] = line[j]  -'a' + 'z' ;
					}else{
						line[j]--;
					}
				}
			}

			for(int k=0 ; k<line.size()-1 ; k++){
				if(line[k] == 't' && line[k+1] == 'h'){
					flag = 1;
					break;
				}
			}
			if(flag == 1) break;
		}
		cout << line << endl;
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
 
#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define SORT(c) sort((c).begin(),(c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
 
typedef long long ll;
typedef pair<int, int> ii;
 
int main(){

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

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

int checkCaesarChipher(string str1, string str2){
	int a[1000],b[1000];
	bool flag = false;
	
	for(unsigned int i=0 ; i<str1.size()-1 ; i++){
		a[i] = (str1[0] - str1[i] + 26 - 'a') % 26;
		b[i] = (str2[0] - str2[i] + 26 - 'a') % 26;
		if(a[i]==b[i]){
			flag = true;
		}else{
			flag = false;
			break;
		}
	}
	if(flag){
		return (str2[0] - str1[0]);
	}else{
		return 0;
	}
}

int main(){
	string str[400];
	int i=0, ans=0;
	while(cin >> str[i]){
		
		i++;
	}
	for(int j=0 ; j<i ; i++){
		ans = 0;
		if(str[j].size()==3){
			string hoge1 = "the";
			if(checkCaesarChipher( hoge1 , str[j] )!=0){
				ans = checkCaesarChipher( hoge1 , str[j] );
				break;
			}
		}
		if(str[j].size()==4){
			string hoge2 = "that";
			if(checkCaesarChipher( hoge2 , str[j] )!=0){
				ans = checkCaesarChipher( hoge2 , str[j] );
				break;
			}
			string hoge3 = "this";
			if(checkCaesarChipher( hoge3 , str[j] )!=0){
				ans = checkCaesarChipher( hoge3 , str[j] );
				break;
			}
		}
	}
	if(ans!=0){
		for(int j=0 ; j<i ; j++){
			for(unsigned int k=0 ; k<str[j].size() ; k++){
				if(str[j][ str[j].size()-1] != '.'){
					str[j].at(k) -= ans;
				}
			}
			if(j==i-1) cout << str[j] << endl;
			else cout << str[j] << " ";
		}
	}
	return 0;
}

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

using namespace std;


int main(){

	string line;

	while(getline(cin, line)){

		string str[80], ans[80];
		int count = 0;
		int flag = 0;
		int slide;

		//???????????????
		string temp;
		for(int i=0 ; i<line.size()-1 ; i++){
			temp += line[i];
		}
		line = temp;

		//???????????????????????¨???????´?
		for(int i=0 ; i<line.size() ; i++){
			if(line[i] == ' '){
				count++;
			}else{
				str[count] += line[i];
				ans[count] = str[count];
			}
		}
		count++;


		for(int i=1 ; i<=26 ; i++){
			for(int j=0 ; j<count ; j++){
				for(int k=0 ; k<str[j].size() ; k++){
					if(str[j][k] != '.'){
						str[j][k]++;
						if(str[j][k] > 'z'){
							str[j][k] = str[j][k] - 'z' + 'a' -1;
						}
					}
				}

				if(str[j] == "this" || str[j] == "the" || str[j] == "that"
						|| str[j] == "this." || str[j] == "the." ||str[j] == "that."){
					flag = 1;
					slide = i;
					break;
				}
			}
			if(flag == 1)break;
		}

		for(int i=0 ; i<count ; i++){
			for(int j=0 ; j<ans[i].size() ; j++){
				if(ans[i][j] != '.'){
					if((ans[i][j] + slide) > 'z' ){
						ans[i][j] = ans[i][j] - 'z' + 'a' + slide -1;
					}else{
						ans[i][j] = ans[i][j] + slide ;
					}
				}
			}
		}

		for(int i=0 ; i<count ; i++){
			cout << ans[i] << ' ';
		}
		cout << ans[count] << endl;

	}
	return 0;
}

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;
}