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>
#include<cstring>

bool find(const std::string &text, const std::string pattern){
	int text_i=0,pattern_i=0;
	while(text_i<text.size()&&pattern_i<pattern.size()){
		if(text[text_i]==pattern[pattern_i]) {
			text_i++;
			pattern_i++;
		}else{
			pattern_i=0;
			text_i=text_i-pattern_i+1;
		}
	}
	return (pattern_i==pattern.size()?true:false);
}


void decode( std::string &coded_data,int diff){
	for(int i=0;i<coded_data.size();i++){
		if(isalpha(coded_data[i])){
			coded_data[i]-=diff;
			if(!isalpha(coded_data[i])) coded_data[i]+=26;
		}
	}
}

int main(void){
	std::string coded_data;
	while(std::getline(std::cin,coded_data)){
		for(int i=0;i<26;i++){
			decode(coded_data,1);
			if(find(coded_data,"the") || find(coded_data,"this")||find(coded_data,"that"))
				std::cout<<coded_data<<std::endl;
		}
	}

	return 0;
}

C++: #include<iostream>
#include<string>
#include<cctype>
using namespace std;
 
int main(void)
{
    string str;
    while( getline(cin, str) )
    {
        int i;
        int s = str.size();
        const string::size_type N = string::npos;
        while( str.find("the")==N && str.find("this")==N && str.find("that")==N )
        {
            for(i = 0; i < s; i++)
            {
                if(isalpha(str[i]))
                {
                    str[i] = (str[i]-'a'+1)%26+'a';
                }
            }
        }
        cout << str << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>

using namespace std;


#define all(c) ((c).begin()), ((c).end())
#define debug(c) cerr << "> " << #c << " = " << (c) << endl;
#define iter(c) __typeof((c).begin())
#define present(c, e) ((c).find((e)) != (c).end())
#define cpresent(c, e) (find(all(c), (e)) != (c).end())
#define tr(i, c) for (iter(c) i = (c).begin(); i != (c).end(); i++)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, a, b) for (int i = (int)(a); i <= (int)(b); i++)

#define mp make_pair
#define fst first
#define snd second
#define pb push_back


const double EPS = 1e-10;


typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef complex<double> P;


int main(){
	for (string s; getline(cin, s); ) {
		rep (i, 26) {
			rep (j, s.size()) if (isalpha(s[j])) {
				s[j]++;
				if (s[j] > 'z') s[j] = 'a';
			}
			if (s.find("the") != -1 || s.find("this") != -1 || s.find("that") != -1) break;
		}
		cout << s << endl;
	}
	
	return 0;
}

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

int main() {
	string sa;
	while (getline(cin, sa)&& sa != "END OF INPUT") {
		int a = sa.size();
		while (1) {
			for (int i = 0; i < a; i++) {
				if (sa[i] >='a' && sa[i] <='z') {
					sa[i] += 1;
				}
					if (sa[i]>'z'){
						sa[i] -= 26;
					}				
			}
			size_t za=sa.find(" this "||" that "||" the ");
			if (za != string::npos) {break;}
		}
		cout << sa << endl;
	}
	return 0;
}

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

int main(){
    char a[81];
    int size;
    int i,t;
    while(fgets(a,81,stdin)!=NULL){
    size = strlen(a);
    for(t=0;t<26;t++){
        for(i=0;i<size;i++)if(isalpha(a[i]))a[i] = 'a'+(a[i]+1-'a')%26;
        for(i=0;i<size;i++){
            if(a[i]=='t'&&a[i+1]=='h'){
                if(a[i+2]=='e'||(a[i+2]=='i'&&a[i+3]=='s')||(a[i+2]=='a'&&a[i+3]=='t')){
                    printf("%s",a);
                    break;
                }
            }
        }
    }
    }
}

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

int main(){
	string str[80];
	int shi_rate;
	int p;
	bool flag, shifted;
	
	p = 0;
	flag = false;
	shifted = false;
	while(!flag){
		cin >> str[p];
		
		if(str[p][str[p].size() - 1] == '.') flag = true;
		
		if(!flag && !shifted){
			if(str[p].size() == 3){
				if(str[p][2] - str[p][1] == -3 && str[p][0] - str[p][1] == 12){
					shi_rate = str[p][0] - 116;
					shifted = true;
				}
			}
			else if(str[p].size() == 4){
				if(str[p][0] - str[p][1] == 12 &&
				 ((str[p][0] == str[p][3] && str[p][3] - str[p][2] == 19) ||
				  (str[p][3] - str[p][2] == 10 && str[p][2] - str[p][1] == 1))){
					shi_rate = str[p][0] - 116;
					shifted = true;
				}
			}
		}
		else if(flag && !shifted){
			if(str[p].size() == 4){
				if(str[p][2] - str[p][1] == -3 && str[p][0] - str[p][1] == 12){
					shi_rate = str[p][0] - 116;
					shifted = true;
				}
			}
			else if(str[p].size() == 5){
				if(str[p][0] - str[p][1] == 12 &&
				 ((str[p][0] == str[p][3] && str[p][3] - str[p][2] == 19) ||
				  (str[p][3] - str[p][2] == 10 && str[p][2] - str[p][1] == 1))){
					shi_rate = str[p][0] - 116;
					shifted = true;
				}
			}
		}
		p++;
	}
	
	for(int i = 0; i < p; i++){
		for(int j = 0; j < str[i].size(); j++){
			if(str[i][j] != '.') cout << (char)(str[i][j] - shi_rate);
			else cout << '.';
		}
		if(i < p - 1) cout << " ";
		else cout << endl;
	}
	
	return 0;
}

C++: #include<iostream>
using namespace std;
int main()
{
	char key[80] = "";
	
	while (cin.getline(key, sizeof(key))) {

		for (int i = 0; i < sizeof(key); i++)
		{
			//if (key[i] == (int)" ")cout << "space";
			if ((int)key[i] == 0)break;
			if ((int)key[i] <= 122 && (int)key[i] >= 97)
				key[i] = (int)key[i] - 1;
			if (key[i] == 96)key[i] = 122;
		}
		for (int i = 0; i < sizeof(key); i++)
		{
			if ((int)key[i] == 0)break;
			cout << key[i];
		}
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cstring>
#include <cctype>
#include <string>
#include <algorithm>
#define CHAR_NUM 80
using namespace std;

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