Mr. Hu makes a living by helping the tourists of the little town of Tangkou in every imaginable way. However, to do so, he first needs to bring as many customers as possible to his tiny restaurant (which is in fact his home). When a group of tourists arrives at Tangkou, Mr. Hu is immediately ringed at home by local informers. He then rides his motorbike and rushes to meet the group. Afterwards, as many tourists as the narrow streets of Tangkou permit are softly conducted by Mr. Hu to his home by walk.
Mr. Hu’s business is so successful that he is planning to move it to Shanghai. But Shanghai has so many streets, some of them so long or so wide, that he needs to find the fastest path from home to a certain street intersection, and also the widest path from that intersection back home. (The wideness of a path is the minimum of the wideness of its streets.) Can you help him?
Input is all integers, and consists of several cases, each one beginning with a line with , , , and : is the number of street intersections (numbered from 0 to ), is the number of streets connecting them, is the intersection number of Mr. Hu’s home, is the intersection number of the group of tourists, and is the number of tourists. Assume , , that and are different, and .
Then lines follow, one for every street, each with four numbers , , and . The first two are the intersection numbers of the beginning and of the end of the street. is the time to drive the street from to (or from to , assume no difference). A special value of for indicates that it is not allowed to drive the street connecting to . is the number of people, Mr. Hu included, that can walk at the same time the street from to (or from to ). Suppose , , and .
There is no more than one street connecting two intersections. There is always at least one path from to . A special case with marks the end of input.
For every case, print the optimal time to drive from to , and also the maximum number of tourists that Mr. Hu can bring home.
Input
6 8 1 0 100 0 1 18 35 0 3 6 90 3 4 5 55 1 4 8 40 1 2 4 60 2 4 -1 65 4 5 1 80 3 5 3 70 2 1 0 1 100 0 1 10 200 0 0 0 0 0
Output
18 59 10 100