A solution for ICPC Fall 2014 problem A (Hy-phe-na-tion Rulez)