Relations between the Song and Liao remained tense and hostile: in 986 the Song sent three armies against the Liao in an effort to take advantage of an infant emperor and recapture the Sixteen Prefectures, but the Liao successfully repulsed all three armies. Following this, diplomatic relations were resumed. Relations between Song and Liao worsened in the 990s. From 993 to 1004, the Liao observed the Song as the latter built a 'Great Ditch' in northern Hebei province from the Taihang Mountains in the west all the way to the Bohai Sea in the east. This was essentially a series of canals meant to block the advance of Liao cavalry far from the northern border line, although the Liao perceived this engineering project as a means for the Song to dispatch offensive forces more efficiently via new waterways. In 999 the Liao began annual attacks on Song positions, though with no breakthrough victories. The Liao were interested in capturing the Guannan region of northern Hebei, both because the Song general Zhou Shizong had taken it from them and because it contained strategic passes.