This pair of couplets should be before the Tang Dynasty at the latest, and it is included in Yan Zhenqing Duo Pagoda ji zi Couplet.
Yan Zhenqing (August 23, 709-784), whose real name was Chen Qing, nicknamed Xianmenzi, alias Fang Ying, was born in Jingzhao Wanzhao (now Xi, Shaanxi), and his ancestral home was Langjia Linyi (now Zhumanliu Village, Fangcheng Town, lanshan district, Linyi, Shandong). Yan Shigu V was a famous minister and outstanding calligrapher in Tang Dynasty.