From every course, the effort your need spend is different. The different orders you took the course.
Will affect the effort you need for the next course. For example: If you took “Basic Computer Programming” before, the effort you need to spend on “Data Structure” is 2.
Find the path with minimal effort needs to spend. To apply for the target course.
First-line contains two integers N, M. Where n is the number of courses and m is the number of edges between two courses.
Following two lines are two characters for the start course and end course.
Following M lines contain one edge each, in form A B c.Which means that there exists an from course A to course B cost c.
In the first line, please print the minimal cost to take the course from start course to end course.
In the second-line please print the node on the shortest path. There is no white space or new line in the end.