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>

using namespace std;

inline int Rotate(char a, char b) {
	return (a - b + ('z' - 'a' + 1)) % ('z' - 'a' + 1);
}

int main(void) {
	char str[81];
	int shift = 0;
	while(cin.getline(str, 81)) {
		shift = 0;
		for(int i = 0; str[i] != NULL; i++) {
			if((str[i] != NULL) && (str[i+1] != NULL) && (str[i+2] != NULL) &&
				(str[i] != ' ') && (str[i+1] != ' ') && (str[i+2] != ' ')) {
					if(Rotate(str[i+1], str[i]) == Rotate('h', 't')) {
						if(Rotate(str[i+2], str[i+1]) == Rotate('e', 'h')) {
							shift = 't' - str[i];
							break;
						}
						if(str[i+3] != NULL && str[i+3] != ' ') {
							if((Rotate(str[i+2], str[i+1]) == Rotate('i', 'h')) && (Rotate(str[i+3], str[i+2]) == Rotate('s', 'i'))) {
								shift = 't' - str[i];
								break;
							}
							if((Rotate(str[i+2], str[i+1]) == Rotate('a', 'h')) && (Rotate(str[i+3], str[i+2]) == Rotate('t', 'a'))) {
								shift = 't' - str[i];
								break;
							}
						}
					}
			}
		}

		for(int i = 0; str[i] != NULL; i++) {
			if(str[i] != ' ' && str[i] != '.') {
				str[i] = (str[i] - 'a' + shift + ('z' - 'a' + 1)) % ('z' - 'a' + 1) + 'a';
			}
		}

		cout << str << endl;
	}
	return 0;
}

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

int main(){
	string str;
	string key_1 = "the",key_2 = "this",key_3 = "that";
	
	while(getline(cin,str))
	{
		for(int i=0;i<26;i++)
		{
			for(int j=0;j<str.size();j++)
			{
				if(str[j]!=' ' && str[j]!='.')
				{
					str[j]++;
					if(str[j] > 'z')str[j] -= 26;
				}
			}
			if(str.find(key_1)!= -1) cout << str << endl;
			else if(str.find(key_2)!= -1) cout << str << endl;
			else if(str.find(key_3)!= -1) cout << str << endl;
		}
	}
}

C++: #include<iostream>
#include<string>
using namespace std;
char data[26] = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
int main(){
  string s[80];
  int count = 0;
  while(cin >> s[count]) count++;
  bool roop = true;
  while(roop){
    for(int i=0;i<=count;i++){
      for(int j=0;j<s[i].size();j++){
	if(s[i][j]=='z') s[i][j] = 'a';
	if(s[i][j]=='.') continue;
	else s[i][j] = data[int(s[i][j]-'`')]; 
	//cout << s[i][j] << endl;
      }
      if(s[i]=="the"||s[i]=="this"||s[i]=="that") roop = false;
    }
  }
  for(int i=0;i<=count;i++){
    cout << s[i];
    if(i!=count) cout << ' ';
  }
  cout << endl;
  return 0;
}

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

int main(){
	string input;

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

	return 0;
}

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

using namespace std;

int main(void){
	int i, j;
	string s, suc1("the"), suc2("this"), suc3("that");
	getline(cin,s);
	while(s.find(suc1) == -1 && s.find(suc2) == -1 && s.find(suc3) == -1){	
		for(j = 0;j < s.size();j++){
			if(s[j] == 'z')
				s[j] = 'a';
			else if(isalpha(s[j]))
				s[j]++;
		}
	}
	cout << s << endl;
	return 0;
}

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

int main(){

  string s;
  int k = 0;

  getline(cin,s);

  for(int i=0;i<s.size();i++){
    for(int j=-25;j<26;j++){
      if(s[i]+j == 't' && s[i+1]+j == 'h'){
	if(s[i+2]+j == 'e') k = j;
	if(s[i+2]+j == 'i' && s[i+3]+j == 's') k = j;
	if(s[i+2]+j == 'a' && s[i+3]+j == 't') k = j;
      }
    }
  }

    for(int i=0;i<s.size();i++){
      if(s[i] <= 'z' && s[i] >= 'a') cout << (char)(s[i]+k);
      else cout << s[i];
    }

    cout << endl;

}

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

using namespace std;

typedef pair<int,int> pii;

#define rep(i,j) for(int i=0;i<(j);i++)
#define reps(i,j,k) for(int i=j;i<=k;i++)
#define in(i,j,k) ((i)>=(j)&&(i)<=(k))


int main(){
	char s[81];
	int l;
	for(;;){
		gets(s);
		if(s[0]==0)break;
		l=strlen(s);
		while(strstr(s,"the")==NULL && strstr(s,"that")==NULL && strstr(s,"this")==NULL){
			rep(i,l){
				if(in(s[i],'a','z')){
					s[i]++;
					if(s[i]>'z')s[i]-=26;
				}
			}
		}
		puts(s);
	}
	return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <functional>
#include <complex>

using namespace std;

const double PI=3.14159265;

int main()
{
	string s;
	getline(cin,s);

	for(int i=0;i<=25;i++){
		if(s.find("the")!=string::npos || s.find("this")!=string::npos
		   ||s.find("that")!=string::npos){
			cout<<s<<endl;
			break;
		}

		for(unsigned int j=0;j<s.size();j++){
			if(s[j]>='a' && s[j]<='z') s[j]=(s[j]-'a'+1)%26+'a';
		}

	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  string str[80];
  vector<int> num;
  int i=0;
  while(cin>>str[i]){
    if(str[i].size()==4||str[i].size()==3)
      num.push_back((str[i].size()*100)+i);
  }
  int flag=0,zure=0;
  for(int i=0;i<num.size();i++){
    if(num[i]/100==3){
      for(int j=0;j<3;j++){
	for(int k=1;k<26;k++){
	  if(str[num[i]-300][0]=='t'+k){
	    if(str[num[i]-300][1]=='h'+k&&str[num[i]-300][2]=='e'+k){
	      zure=k;flag=1;break;
	    }
	  }
	}
	if(flag==1)
	  break;
      }
      if(flag==1)
	break;
    }
    else{
      for(int j=0;j<4;j++){
	for(int k=1;k<26;k++){
	  if(str[num[i]-400][0]=='t'+k&&str[num[i]-400][1]=='h'+k){
	    if(str[num[i]-400][2]=='i'+k&&str[num[i]-400][3]=='s'+k||str[num[i]-400][2]=='a'+k&&str[num[i]-400][2]=='t'+k){
	      zure=k;flag=1;break;
	    }
	  }
	}
	if(flag==1)
	  break;
      }
      if(flag==1)
	break;
    }
    i++;
  }
  for(int j=0;j<10;j++){
    for(int k=0;k<str[j].size();k++){
      str[j][k]=str[j][k]+zure;
    }
  }
  for(int j=0;j<10;j++){
    cout<<str[j];
    if(j!=10)
      cout<<" ";
  }cout<<endl;
  return 0;
}