{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv\u003e\u003cp\u003eJohn is the only priest in his town. September 1st is the John\u0027s busiest day in a year because there is an old legend in the town that the couple who get married on that day will be forever blessed by the God of Love. This year \u003ci\u003eN\u003c/i\u003e couples plan to get married on the blessed day. The \u003ci\u003ei\u003c/i\u003e-th couple plan to hold their wedding from time \u003ci\u003eS\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e to time \u003ci\u003eT\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e. According to the traditions in the town, there must be a special ceremony on which the couple stand before the priest and accept blessings. The \u003ci\u003ei\u003c/i\u003e-th couple need \u003ci\u003eD\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e minutes to finish this ceremony. Moreover, this ceremony must be either at the beginning or the ending of the wedding (i.e. it must be either from \u003ci\u003eS\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e to \u003ci\u003eS\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e + \u003ci\u003eD\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e, or from \u003ci\u003eT\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e - \u003ci\u003eD\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e to \u003ci\u003eT\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e). Could you tell John how to arrange his schedule so that he can present at every special ceremonies of the weddings.\u003c/p\u003e\u003cp\u003eNote that John can not be present at two weddings simultaneously.\u003c/p\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains a integer \u003ci\u003eN\u003c/i\u003e ( 1 ≤ \u003ci\u003eN\u003c/i\u003e ≤ 1000). \u003cbr\u003eThe next \u003ci\u003eN\u003c/i\u003e lines contain the \u003ci\u003eS\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e, \u003ci\u003eT\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e and \u003ci\u003eD\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e. \u003ci\u003eS\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e and \u003ci\u003eT\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e are in the format of \u003ci\u003ehh:mm\u003c/i\u003e. \u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eThe first line of output contains \"YES\" or \"NO\" indicating whether John can be present at every special ceremony. If it is \"YES\", output another \u003ci\u003eN\u003c/i\u003e lines describing the staring time and finishing time of all the ceremonies.\u003c/p\u003e"}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e2\n08:00 09:00 30\n08:15 09:00 20\n\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYES\n08:00 08:30\n08:40 09:00\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Hint","value":{"format":"HTML","content":"If one ceremony ends at the same time another begins, they are not considered simultaneous."}}]}