Su Hui, a fourth century Chinese poet, wrote a poem in the form of a twenty-nine by twenty-nine character grid. Each line can be read forward or backwards, horizontally, vertically, or diagonally. This arrangement allows for 7,940 different readings.
Su Hui was known for an important and unusual poem. This was described in contemporary sources as shuttle-woven on brocade, meant to be read in a circle, and consisting of 112 or else 840 characters. By the Tang period, the following story about the poem was current
Dou Tao of Qinzhou was exiled to the desert, away from his wife Lady Su. Upon departure from Su, Dou swore that he would not marry another person. However, as soon as he arrived in the desert region, he married someone. Lady Su composed a circular poem, wove it into a piece of brocade, and sent it to him.
Another source, naming the poem as Xuanji Tu (Picture of the Turning Sphere), claims that it was a palindromic poem comprehensible only to Dou (which would explain why none of the Tang sources reprinted it), and that when he read it, he left his desert wife and returned to Su Hui.
The text of the poem was circulated continuously in medieval China and was never lost, but during the Song Dynasty it became scarce. The 112 character version was included in early sources. The earliest excerpts of the 840 character version date from a 10th-century text by Li Fang. Several 13th century copies were attributed to famous women of the Song Dynasty, but falsely so. In the Ming Dynasty the poem became quite popular and scholars discovered 7,940 ways to read it. It was also mentioned in the story Flowers in the Mirror. The poem is in the form of a twenty-nine by twenty-nine character grid, and can be read forward or backwards, horizontally, vertically, or diagonally, as well as within its color-coded grids.