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<string>
#include<algorithm>
#include<cmath>
using namespace std;

void coding(){
  string s;

  while(getline(cin, s)){
    bool flag = false;
    
    while(true){

      for(int i=0;i<s.length();i++){
	
	string key1 = s.substr(i,3);
	string key2 = s.substr(i,4);
	if(key1 == "the" || key2 == "this" || key2 == "that"){
	  flag = true;
	}
      }
      
      if(flag){
	break;
      }else{
	
    
	for(int i=0;i<s.length();i++){
	  if(s[i] > 'a' && s[i] < 'z'){
	    s[i] -= 'a';
	    s[i] += 1;
	    s[i] = s[i]%('A'-'a');
	    s[i] += 'a';
	  }else{
	    continue;
	  }
	}
      }
    }
    cout << s << endl;
  }
}


int main(){
  coding();
}

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

bool valid(string line){
  string t[3] = {"the", "this", "that"};
  for ( int i = 0; i < 3; i++ ){
    if ( line.find(t[i]) != string::npos ) return true;
  }
  return false;
}

void move(string &line){
  for ( int i = 0; i < line.size(); i++ ){
    if ( line[i] == 'a' ) line[i] = 'z';
    else if ( 'b' <= line[i] && line[i] <= 'z' ){
      line[i] = (char)(line[i]-1);
    }
  }
}
main(){
  string line;
  getline(cin, line);
  while(1){
    if ( valid(line) ) {
      cout << line << endl;
      break;
    }
    move(line);
  }
}

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

int main(){
	string h[3] = {"the","that","this"};
	string s;
	while(getline(cin,s)){
	int c = 0;
	for(int j=0;j<ALF;j++){
		for(int m=0;m<3;m++){
			for(int k=0;k<=s.size()-h[m].size();k++){
				string t = s.substr(k,h[m].size());
				for(int l=0;l<h[m].size();l++) t[l] = (t[l]-'a'+j)%ALF + 'a';
				if(t==h[m]) c = j;
			}
		}
	}
	for(int j=0;j<s.size();j++){
		if('a'<=s[j] and s[j]<='z') s[j] = (s[j]-'a'+c)%ALF + 'a';
	}
	cout << s << endl;
	}
}

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

C++: #include<iostream>
#include<algorithm>
#include<string>
#include<cstdio>
#include<cstring>
using namespace std;
int main(){
  string str;
  char s[256];
  while(getline(cin , str)){
    int n = str.size();
    int w = 1;
    memset( s , 0 , sizeof(s));
    for(int i=0;i<=n;i++){
      s[i] = str[i];
    }
    while(1){
    
      for(int i=0;i<n;i++){
	if(s[i] != ' ' && s[i] != '.'){
	  s[i]++;
	  if(s[i]>'z')s[i] = s[i] - 'z' + 'a' - 1;
	}
      }
      if(strstr(s,"the") != NULL)break;
      if(strstr(s,"that") != NULL)break;
      if(strstr(s,"this") != NULL)break;
    }
    printf("%s",s);
  }
}

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

string caesar(string a,int n)
{
	for(int i=0;i<a.length();i++){
		if(isalpha(a[i])){
			a[i]=((a[i]+n>122)?a[i]-26+n:a[i]+n);
		}
	}
	return a;
}

int main()
{
	string a,tmp;
	while(cin>>tmp){
		a+=tmp;
		a+=' ';
	}
	
	for(int i=0;i<26;i++){
		string tmp=caesar(a,i);
		if(tmp.find("the")!=string::npos || tmp.find("that")!=string::npos || tmp.find("this")!=string::npos){
			cout<<tmp<<endl;
			break;
		}
	}
	return 0;
}

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

using namespace std;

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

int main()
{
	solve();
	return(0);
}

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

#define REP(i,s,e) for(int i=int(s);i<=int(e);i++)
#define rep(i,n) for(int i=0;i<int(n);i++)

#define EPS 1e-6

using namespace std;

bool f(string a){

string::size_type p=a.find("the");
string::size_type q=a.find("this");
string::size_type r=a.find("that");
if(p!=string::npos || q!=string::npos || r!=string::npos)
return true;
else return false;

	}

int main(){

   string s,s1;

   while(getline(cin,s)){

	int n=s.size();

		rep(j,26){
		rep(i,n){
		if('a'<=s[i] && s[i]<='y') s[i]++;
		else if(s[i]=='z') s[i]='a';
		}

		if(f(s)){ cout << s << endl; break; }

		}

	}

    return 0;
}

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

int main(){
  string s;

  while(getline(cin, s)){
    int flag = 0;
    
    while(true){

      for(int i=0;i<s.length();i++){
	
	string key1 = s.substr(i,3);
	string key2 = s.substr(i,4);
	if(key1 == "the" || key2 == "this" || key2 == "that"){
	  flag = 1;
	}
      }
      
      if(flag){
	break;
      }else{
	
    
	for(int i=0;i<s.length();i++){
	  if(s[i] >= 'a' && s[i] <= 'z'){
	    // s[i] -= 'a';
	    // s[i] += 1;
	    // s[i] = s[i]%('A'-'a');
	    // s[i] += 'a';

	    s[i] -= 'a' - 'A';
	    s[i] = ('A' + s[i] - 'A' + 26 + 1)%26;
	    s[i] += 'a' - 'A';
	    
	  }else{
	    continue;
	  }
	}
      }
    }
    cout << s << endl;
  }
  return 0;
}