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

C++: #include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <cmath>
#include <string.h>
using namespace std;

#define FOR(i,s,e) for (int i = int(s); i != int(e); i++)
#define REP(i,e) for (int i = 0; i != int(e); i++)
#define FORIT(i, A) for (auto i : A)
#define ISEQ(c) (c).begin(), (c).end()
#define PRINT(x) cout << (x) << endl
#define SZ(x) ((int)(x).size())

int check(const char* word)
{
	if ((word[1] - word[0]) % 26 != ('h'-'t'))
		return -1;

	if ((word[2] - word[1]) % 26 == ('e'-'h') && 
		(word[3] == ' ' || word[3] == '\0' || word[3] == '\n'))
	{
		return (word[0] - 't' + 26) % 26;
	}
	if ((word[2] - word[1]) % 26 == ('a'-'h') && 
		(word[3] - word[2]) % 26 == ('t'-'a') &&
		(word[4] == ' ' || word[4] == '\0' || word[4] == '\n'))
	{
		return (word[0] - 't' + 26) % 26;
	}
	if ((word[2] - word[1]) % 26 == ('i'-'h') && 
		(word[3] - word[2]) % 26 == ('s'-'i') && 
		(word[4] == ' ' || word[4] == '\0' || word[4] == '\n'))
	{
		return (word[0] - 't' + 26) % 26;
	}
	return -1;
}

int main(int argc, char const *argv[])
{
	string s;
	if (getline(std::cin, s))
	{
		int len = s.length();
		int d = check(&s[0]);
		int i = 3;
		while (d == -1)
		{
			while(i < len && s[i] != ' ')
				i++;
			if (i == len) break;
			i++;
			d = check(&s[i]);
		}
		REP(j, len)
		{
			if (s[j] >= 'a' && s[j] <= 'z')
			{
				s[j] = (s[j] - 'a' - d + 26) % 26 + 'a';
			}
		}
		std::cout << s << std::endl;
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
string text;
int i,n;
int main(){
	while(getline(cin,text)){
		n=1;
		while(n!=27){
			i=0;
			while(i!=text.size()){
				if('a'<=text[i]&&text[i]<'z'){
					text[i]+=1;
				}else if(text[i]=='z'){
					text[i]='a';
				}
				i++;
			}
			if(text.find("the")!=-1)break;
			if(text.find("this")!=-1)break;
			if(text.find("that")!=-1)break;
			n++;
		}
		cout <<text<<endl;
	}
	return 0;
}