Go: package main

import (
	"bufio"
	"os"
	"strings"
	"fmt"
)

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 len(infos) == 0 {
			break
		}
		// 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 <cstdio>
#include <iostream>
#include <cstring>

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'};
char trans[100];
char mozi;
int position=0;
int zoom;
int first_check=0,first_position=0;
int now;
char result;

int main(){
	while(scanf("%c",&mozi) != EOF){
		for(int i=0;i<26 && first_check == 0;i++){
			if(mozi == data[i]){
				first_position = i;
				zoom = first_position - 19;
				first_check = 1;
			}
		}




		if(mozi == ' ' || mozi == '.' || mozi == '\n'){
			trans[position] = mozi;
			position++;

			if(mozi == '\n'){
				cout << trans << endl;
				first_check = 0;
				position = 0;
				memset(trans,'\0',sizeof(trans));
			}
		}else{
			for(int i=0;i<26;i++){
				if(data[i] == mozi){
					now = i;
					break;
				}
			}

			trans[position] = data[now - zoom];
			position++;

		}
	}
}

C++: /*0017 written by iPhone*/
#include <iostream>
#include <string>
#include <cstring>

using namespace std;

int main(){
    string s;
    while(getline(cin, s) && s != "\0"){
        for(int i = 0; i < s.size(); i++) s[i]++;
        if(strstr(s.c_str(), "the") || strstr(s.c_str(), "this") || strstr(s.c_str(), "that") ){
            cout << s;
            return 0;
        }
    }
    return 0;
}

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

bool decision(string input){
	for(int i = 0; i < input.size()-3; i++){
		if((input[i] == 't' && input[i+1] == 'h' && input[i+2] == 'e') ||
			(input[i] == 't' && input[i+1] == 'h' && input[i+2] == 'i' && input[i+3] == 's') ||
			(input[i] == 't' && input[i+1] == 'h' && input[i+2] == 'a' && input[i+3] == 't')){
			return true;
		}
	}
	return false;

}

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

	while(getline(cin, input);){
		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(decision(input)) cout << input << endl;
	}

	return 0;
}

C++: #include <iostream>
#include <istream>
#include <cstring>

using namespace std;

int main(int argc, char **argv)
{
	int n;
	char a[82], b[82], t;
	
	while(cin.getline(a, 82, '\n')){
		n = strlen(a);
		for(int i = 0, f = 0; i < 26; i++){
			for(int j = 0; j < n; j++){
				if(a[j] == ' ' || a[j] == '.'){
					b[j] = a[j];
				} else {
					t = a[j] - i;
					if(t < 'a'){
						t += 25;
					} else if(t > 'z'){
						t -= 25;
					}
					b[j] = t;
				}
			}
			
			for(int j = 0; j < n; j++){
				if(b[j] == 't' && j == 0 && b[j+1] == 'h'){
					if(b[j+2] == 'e' && b[j+3] == ' '){
						f = 1;
						break;
					} else if(b[j+2] == 'a' && b[j+3] == 't' && b[j+4] == ' '){
						f = 1;
						break;
					} else if(b[j+2] == 'i' && b[j+3] == 's' && b[j+4] == ' '){
						f = 1;
						break;
					}
				} else if(b[j] == ' ' && b[j+1] == 't' && b[j+2] == 'h'){
					if(a[j+3] == 'e' && a[j+4] == ' '){
						f = 1;
						break;
					} else if(b[j+3] == 'a' && b[j+4] == 't' && b[j+5] == ' '){
						f = 1;
						break;
					} else if(b[j+3] == 'i' && b[j+4] == 's' && b[j+5] == ' '){
						f = 1;
						break;
					}
				}
			}
			if(f == 1){
				for(int i = 0; i < n; i++){
					cout << b[i];
				}
				cout << endl;
				break;
			}
		}
	}
	
	return 0;
}

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

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

int main(void){
	vector<string> v;
	string str;

	while(cin>>str){
		v.push_back(str);
	}

	for(int cif=0;cif!=26;cif++){
		for(int i=0;i<v.size();i++){
			for(int j=0;j<v[i].length();j++){
				if('A'<=v[i][j]&&v[i][j]<='Z'){
					v[i][j]=(v[i][j]-'A'+1)%26+'A';
				}else if('a'<=v[i][j]&&v[i][j]<='z'){
					v[i][j]=(v[i][j]-'a'+1)%26+'a';
				}
			}
		}
		for(int i=0;i<v.size();i++){
			if(v[i]=="that" || v[i]=="the"||v[i]=="this"){
				for(int k=0;k<v.size();k++){
					if(k!=v.size()-1)cout<<v[k]<<" ";
					else cout<<v[k];
				}
				exit(0);
			}
		}
	}
	return 0;
}

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

bool NotMatch( const std::string& str )
{
	return str.find("the") == std::string::npos && str.find("this") == std::string::npos && str.find("that") == std::string::npos;
}

int main()
{
	std::string str;
	while( getline(std::cin,str),str!="END OF INPUT" )
	{
		while( NotMatch(str) )
		{
			for( unsigned i=0; i<str.length(); ++i )
			{
				if( str[i]=='.' || str[i]==' ' || str[i]=='\n' )
				{
					continue;
				}

				if( str[i] == 'z' )
				{
					str[i] = 'a';
				}
				else
				{
					--str[i];
				}
			}
		}

		std::cout << str << '\n';
	}
}

C++: 
#include <cstdio>
#include <cstring>
#define N 1000000 + 10
char a[N];
int next[N];
void getNext(int len){
    next[0] = -1;
    int j = -1,i = 0;
    while (i < len) {
        if (j == -1 || a[i] == a[j]) {
            i ++;
            j ++;
            next[i] = j;
        }
        else j = next[j];
    }
}

int main()
{
    while (scanf("%s",a)) {
        if (a[0] == '.') {
            break;
        }
        int len = strlen(a);
        getNext(len);
        if (len % (len - next[len] == 0)) {
            printf("%d\n",len / (len - next[len]));
        }else {
            printf("1\n");
        }
    }
    return 0;
}

C++: #include<iostream>
#include<string>
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();
}