For centuries, people have been looking for secret messages that are hidden in books, songs played backward1, funny-looking Martian mensas2, or some other objects. Some believe that hidden messages in the Bible cannot be just coincidence — they must have been put in there deliberately by God himself.
The hunt for hidden messages in the Bible has been popularized in modern times by the book The Bible Code3. It was written by American journalist Michael Drosnin, who claims that the Hebrew Bible contains a very complex code that reveals events that took place thousands of years after the Bible was written. Drosnin contends that some foretold events later happened exactly as predicted. Drosnin asserts that the Bible also contains hidden messages that predict the future.
To find hidden messages, Drosnin makes use of a simple technique: start
at a given letter in a text and repeatedly step a fixed number of letters
forward of backward. Consider this verse in the Book of Genesis (King
James Version):
31:28 And hast not suffered me to kiss my sons and my daughters? Thou hast now done foolishly in so doing.
If you start at the R in daughters, skip over three letters to the O in thou, three more to the S in hast, and so on, the hidden message Roswell is revealed! A companion hidden message — UFO — is found by starting at the U in thou, and repeatedly stepping forward 12 letters. This can't be a coincidence, no?
Bible verses Genesis 26:5-10 (King James Version) show that it is also possible to read hidden words backwards, as illustrated for the words BIBLE and CODE.
The claim that no human could have encoded the Bible in this way and that the messages cannot be just coincidence, has been questioned many times. Some critics of Drosnin say the journalist is just data mining: in any text a large amount of hidden messages can be found using Drosnin's technique and a little bit of creativity. Michael Drosnin responded to the criticism in Newsweek, by stating that
When my critics find a message about the assassination of a prime minister encrypted in Moby Dick, I'll believe them.
Mathematician Brendan McKay and his colleagues of the Australian National University took up the challenge, and proved that this really is not all that challenging4.
You are given a Bible verse that contains a hidden word of $$n$$ letters. The hidden word can be read starting at the letter on position $$i$$ and repeatedly stepping forward $$d$$ letters (or backward in case $$d$$ is negative). The characters in the Bible verse that are not letters should be ignored in determining the position of the letters.
The input contains three integers, each on a separate line:
the position $$i \in \mathbb{N}_0$$ of the first letter of the hidden word
the number of positions $$d \in \mathbb{Z}_0$$ you need to step forward ($$d > 0$$) or backward ($$d < 0$$) to find the next letter of the hidden word
the length $$n \in \mathbb{N}_0$$ of the hidden word
This is followed by one or more lines containing the text of the Bible verse. The text itself ends with an empty line.
The hidden word that can be read from the given Bible verse if the instructions as described by the input are followed. In case reading the hidden word falls beyond the start (in case you need to read backwards) or the end (in case you need to read forward) of the Bible verse, the hidden word must be completed with extra question marks at the end, until it has the required length.
Input:
45
4
7
And hast not suffered me to kiss my sons and my daughters?
thou hast now done foolishly in so doing.
Output:
roswell
Input:
14 19 7 Do not be anxious about anything, but in everything, by prayer and petition, with thanksgiving, present your requests to God.
Output:
sense??
Input:
30 -3 3 I could destroy you, but the God of your father appeared to me last night and told me, 'Be careful about what you say to Jacob!
Output:
ufo
Begley S (1997). Seek and ye shall find. Newsweek, June 9, 66-67. 5
Drosnin M (1997). The Bible Code. New York: Simon and Schuster. 6
Gardner M (1997). Farrakhan, Cabala, Baha'i, and 19. Skeptical Inquirer 21(2), 16-18. 7
Hewitt VJ, Lorie P (1991). Nostradamus: The End of The Millenium. New York: Simon and Schuster. 8
Hoagland RC (1992). The Monuments of Mars: A City on the Edge of Forever. Berkeley, California: North Atlantic Books. 9
Van Biema D (1997). Deciphering God's plan. Time, June 9, 56. 10
Witzum D, Rips E, Rosenburg Y (1994). Equidistant letter sequences in the Book of Genesis. Statistical Science 9(3). 11