in put file is a txt file and the contents are:

AB5 AD2 AE4 BC3 BD6 BE8 CE8 DE6
DISTANCE CBAE
DISTANCE DEABD
SHORTEST CA
POSSIBLE CA15