vyadhatta tirtham uddhrtya
tasyah-of the she-goat; uddharana-upayam-the means of deliverance (from the well); bastah-the he-goat; kami-having lusty desires; vicintayan-planning; vyadhatta-executed; tirtham-a way to come out; uddhrtya-digging the earth; visana-agrena-by the point of the horns; rodhasi-at the edge of the well.