{"trustable":true,"sections":[{"title":"","value":{"format":"MD","content":"As Aladdin invited all people in the town to share his happiness and joy, all people came to meet him. And he arranged a **Grand Feast** for them. There were many delicious food items, fruits, drinks, sweets and a lot more.\n\nAs like a regular function, each person had a particular arrival time **(a\u003csub\u003ei\u003c/sub\u003e)** and departure time **(d\u003csub\u003ei\u003c/sub\u003e)**. It means, he can start eating in time **a\u003csub\u003ei\u003c/sub\u003e**, and cannot eat after time **d\u003csub\u003ei\u003c/sub\u003e - 1**. And of course not all of them wanted to have the same amount of food. So, a person wanted to eat **exactly** **f\u003csub\u003ei\u003c/sub\u003e** unit of food and of course within his arrival and departure time. Note that a person can have one unit of food in one time unit.\n\nBut there were only **t** tables, and each table had **c** chairs. So, in a single time unit, at most **t * c** people can eat together. But in the next time unit, a new group of people can replace them (takes negligible amount of time). So, Aladdin made a schedule (when to eat and where to sit) for the persons such that all became happy.\n\nNow your task is to do the same. You are given all the necessary information, your task is to find a schedule for the persons such that everyone becomes happy. A person is happy if he gets exactly **f\u003csub\u003ei\u003c/sub\u003e** unit of food in his time interval. Assume that the feast will last long until all the persons are gone."}},{"title":"Input","value":{"format":"MD","content":"Input starts with an integer **T (\u0026#8804; 30)**, denoting the number of test cases.\n\nEach case starts with a blank line. Next line contains four integers: **n t c e (1 \u0026#8804; n \u0026#8804; 50, 1 \u0026#8804; t, c \u0026#8804; 5, 2 \u0026#8804; e \u0026#8804; 10\u003csup\u003e4\u003c/sup\u003e),** where **n** denotes the number of invited people and **e** denotes the end time of the feast.** **Each of the next **n** lines contains three integers: **a\u003csub\u003ei\u003c/sub\u003e d\u003csub\u003ei\u003c/sub\u003e f\u003csub\u003ei\u003c/sub\u003e (1 \u0026#8804; a\u003csub\u003ei\u003c/sub\u003e \u0026lt; d\u003csub\u003ei\u003c/sub\u003e \u0026#8804; e, 1 \u0026#8804; f\u003csub\u003ei\u003c/sub\u003e \u0026#8804; d\u003csub\u003ei\u003c/sub\u003e - a\u003csub\u003ei\u003c/sub\u003e)**."}},{"title":"Output","value":{"format":"MD","content":"For each case, print the case number and `Yes` if it\u0027s possible to make everyone happy. Print `No` otherwise.\n\nIf the result is yes, then print additional **e-1** lines. The **i\u003csup\u003eth\u003c/sup\u003e** line should contain the persons sitting in the tables in **i\u003csup\u003eth\u003c/sup\u003e** time in the following format:\n\n1. First 26 persons should be identified by the lower case English letters; the next ones should be identified by capital letters (in same order). So, person 6 is **\u0027f\u0027**, and person 28 is **\u0027B\u0027**.\n2. Each table should be denoted by **c** characters, where a **\u0027.\u0027** denotes the chair in that table is empty; otherwise it should contain the person who is eating here. Print all the tables in a single line. Two tables should be separated by a **\u0027|\u0027** character. See the samples for more details.\n\nThere can be multiple solutions, any valid one will do."}},{"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\u003e3\n\n1 1 2 3\n1 3 2\n\n7 2 3 5\n1 4 3\n1 5 4\n1 5 4\n1 2 1\n2 4 2\n2 5 2\n3 5 1\n\n4 1 3 3\n1 3 2\n1 3 1\n1 3 2\n1 3 2\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase 1: Yes\n.a\n.a\nCase 2: Yes\n..a|bcd\n.ab|cef\n..a|bce\n..b|cfg\nCase 3: No\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"MD","content":"1. Dataset is huge, use faster I/O methods.\n2. This is a special judge problem; wrong output format may cause \u0027Wrong Answer\u0027."}}]}