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

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
#define ALL(a)  (a).begin(),(a).end()
#define REP(i,n) for(int i=0;i<(n);++i)
const double EPS = 1e-10;
const double PI  = acos(-1.0);
#define dump(x) cerr << "  (L" << __LINE__ << ") " << #x << " = " << (x) << endl;
#define dumpv(x) cerr << "  (L" << __LINE__ << ") " << #x << " = "; REP(q,(x).size()) cerr << (x)[q] << " "; cerr << endl;
template<typename T1, typename T2>
ostream& operator<<(ostream& s, const pair<T1, T2>& d) {return s << "(" << d.first << "," << d.second << ")";}

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

C++: #include <iostream>
#include <cstdio>
#include <algorithm>

using namespace std;

int main(){
	
	string c = "                                                                                                                                                       ";
	
	bool checker;
	
	while(true){
		
		getline(cin, c);
		
		if(cin.eof()){
			break;
		}
		
		for(int i = 0; i < 26; i++){
			for(int j = 0; j < 2000; j++){
				if(c[j] == '\0'){
					break;
				}else if(c[j] == 'z'){
					c[j] = 'a';
				}else if(c[j] == ' '){
					c[j] = ' ';
				}else if(c[j] == '.'){
					c[j] = '.';
				}else{
					c[j]++;
				}
			}
			
			checker = false;
			
			for(int j = 0; j < 2000; j++){
				if(c[j] == '\0'){
					break;
				}
				if(c[j] == 't' && c[j + 1] == 'h'){
					if(c[j + 2] == 'e'){
						checker = true;
						break;
					}else if(c[j + 2] == 'i' && c[j + 3] == 's'){
						checker = true;
						break;
					}else if(c[j + 2] == 'a' && c[j + 3] == 't'){
						checker = true;
						break;
					}
				}
			}
			
			if(checker){
				break;
			}
		}
		
		for(int i = 0; i < 2000; i++){
			if(c[i] == '\0'){
				break;
			}
			cout << c[i];
		}
		cout << endl;
	}
	
	return 0;
}

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

using namespace std;

int main() {
	string str;
	string in;
	vector<string> s;
	while (cin >> in) s.push_back(in);
	for (int i=0; i<(int)s.size(); i++) {
		str += s[i];
		if (i<(int)s.size()-1) str += " ";
	}
	
	for (int i=1; i<=26; i++) {
		for (int j=0; j<(int)str.size(); j++) {
			if (str[j] == '.' || str[j] == ' ') continue;
			str[j] = str[j] + i;
			if (str[j] >= 'z') str[j] = 'a' + str[j] - 'z';
		}
		if (str.find("the")!=str.npos || str.find("this")!=str.npos || str.find("that")!=str.npos) break;
	}
	
	cout << str << endl;
	
	return 0;
}

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

int main(void){
	char data[100];
	char s1[]="the",
		 s2[]="this",
		 s3[]="that";
	int i,cnt=0;
	char *p;

	while((fgets(data,100,stdin))){
		while(cnt<=26){
			p=strstr(data,s1);
			if(p)
				break;
			p=strstr(data,s2);
			if(p)
				break;
			p=strstr(data,s3);
			if(p)
				break;
			for(i=0;i<100;i++){
				if(data[i]=='\0')
					break;
				if('a'<=data[i] && data[i]<='y')
					data[i]++;
				if('z'==data[i])
					data[i]='a';
			}
			cnt++;
		}
		cnt=0;
		printf("%s",data);
	}
	return 0;
}

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

using namespace std;

int main() { 
  string input_str;

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

  return 0;
}

C++: #include <bits/stdc++.h>

2.using namespace std;

3.//????????????????????????????????????

4.void Check(const string& str){

5.  string strparent=str;

6.  int gap=1;

7.  while(strparent.find("the")==(string::npos)&&

8.        strparent.find("this")==(string::npos)&&

9.        strparent.find("that")==(string::npos)){

10.    for(int i=0;i<str.length();i++){

11.      if(!isalpha(str[i]))continue;//" "

12.      //strparent[i]=(gap+str[i]-'a')%26+'a';

13.      strparent[i]=(gap+str[i])%26+'a';

14.    }

15.    gap++;

16.  }

17.  cout<<strparent<<endl;

18.}

19. 

20.int main(){

21.  string str;

22.  while(getline(cin,str)){

23.    Check(str);

24.  }

25.}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)
int diff(char c, char base) {
    return (c-base+26)%26;
}
int conv(char c, int d) {
    return (c-d-'a'+26)%26+'a';
}
int main(void){
    string s;
    while(getline(cin, s)) {
        int d;
        rep(i, s.size()) {
            if(i<s.size()-3 &&
                    (diff(s[i], 't') == diff(s[i+1], 'h') &&
                     diff(s[i], 't') == diff(s[i+2], 'i') &&
                     diff(s[i], 't') == diff(s[i+3], 's')) || 
                    (diff(s[i], 't') == diff(s[i+1], 'h') &&
                     diff(s[i], 't') == diff(s[i+2], 'a') &&
                     diff(s[i], 't') == diff(s[i+3], 't'))) {
                d = diff(s[i], 't');
                break;
            }
            if(i<s.size()-2 &&
                    (diff(s[i], 't') == diff(s[i+1], 'h') &&
                     diff(s[i], 't') == diff(s[i+2], 'e'))) {
                d = diff(s[i], 't');
                break;
            }
        }
        rep(i, s.size()) {
            if(s[i] >='a' && s[i]<='z') s[i] = conv(s[i], d);
        }
        cout << s << endl;
    }
}