Sānzhǔsì 三祖寺 on 天柱山 Heaven Pillar Mountain in Anhui. Said to have been established by the monk Bǎozhì 寶志, a monk from the Dàolínsì 道林寺 in Nanjing,in the Southern Liang Dynasty 南梁朝 (502-557).
A Daoist monk, Báihè Dàoren 白鶴道人, White Crane Daoist, also had staked a claim to this location and the two of them fought for control. Both petitioned the emperor to build a temple here. The emperor ordered them to demonstrate by magic which one had more power over the mountain. Bǎozhì conjured a tin stave to fly to the mountain and make a well thereby winning the contest.
Báihè Dàoren was forced to move to another site nearby where he built a temple named Zhēnyuángōng 真源宮. Three bothers gave Bǎozhì land to build the 菩提庵 Pútíānan. In 536 the name was changed to Shāngǔān 山谷庵.
In the Běizhōu 北周 (550-572), during the proscription of Buddhism, the Second Chan Ancestor Huìkě 慧可 sent the Third Ancestor Sēngcàn 僧燦 to hide for ten years between Tianzhushan 天株山 and Sīkōngshān 司空山. During the Sui Dynasty Sēngcàn 僧燦 reopened Shāngǔān 山谷庵. In 601 Sengcan went to Jiangxi and passed his robe to the Fourth Ancestor Dàoxìn 道信. In 606 Sencan passed away at the Shangusi. The Tang emperor Suzong in 758 changed the name of the temple to Sānzǔsì 三祖寺.
*( The Zhenyuangong no longer exists, but it's well still serves the local farmers. It is located a short hike over a ridge west of the Sanzusi. A farmhouse and storehouse now sit on the site. The well is in a depression by a small pond. At one time it must have been very large for there were over 3000 monks in residence. It destroyed many times most notably at the end of the Song dynasty but even until the 1940's there were three buildings still standing.)