are random fortunes written on strips of paper at Shinto shrines and Buddhist temples in Japan. Literally "sacred lot", these are usually received by making a small offering and randomly choosing one from a box, hoping for the resulting fortune to be good. , coin-slot machines sometimes dispense . The predicts the person's chances of their hopes coming true, of finding a good match, or generally matters of health, fortune, life, etc. When the prediction is bad, it is a custom to fold up the strip of paper and attach it to a pine tree or a wall of metal wires alongside other bad fortunes in the temple or shrine grounds. A purported reason for this custom is a pun on the word for and the verb , the idea being that the bad luck will wait by the tree rather than attach itself to the bearer. In the event of the fortune being good, the bearer has two options: they can also tie it to the tree or wires so that the fortune has a greater effect or they can keep it for luck. are available at many shrines and temples, and remain one of the traditional activities related to shrine or temple-going. A similar custom of writing a prayer on a specially-prepared wooden block called an , which is then tied to an ad hoc scaffold, also exists. History The sequence historically commonly used in Japanese Buddhist temples, consisting of one hundred prophetic five-character quatrains, is traditionally attributed to the Heian period Tendai monk Ryōgen (912–985), posthumously known as or more popularly, , and is thus called or the , after a legend claiming that these verses were revealed to him by the Bodhisattva Avalokiteśvara (Kannon). Historically, however, the Japanese system is thought to have been modeled after the Chinese , a similar form of divination involving a tube full of bamboo sticks and a sequence of written or printed oracles. A wooden container containing oracular lots dated 1409 (Ōei 16) is preserved in Tendai-ji in Iwate Prefecture, suggesting that this method of fortune telling was imported to Japan somewhere before the Muromachi period (1336–1573). The quatrains of the are themselves ultimately based on a set of oracles dating from the Southern Song period (1127-1279) known as the (, ; Japanese: ). The became popular in the Edo period due to the notable monk Tenkai (1536–1643), who is