{"trustable":true,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eThe Ingenious Candy Processing Company (ICPC) recently hits the market with a new kind of candy. The ICPC is planning to display $$$n$$$ advertisement posters on the screen at the center of the market, labeled by $$$1,2,\\cdots,n$$$. The screen consists of multiple pixels, and each ad poster will occupy $$$w\\times h$$$ pixels. Specifically, the $$$k$$$-th ad poster will occupy all the pixels $$$(i,j)$$$ such that $$$x_k\\leq i\\leq x_k+w-1$$$ and $$$y_k\\leq j\\leq y_k+h-1$$$ from the morning of the $$$l_k$$$-th day to the night of the $$$r_k$$$-th day.\u003c/p\u003e\u003ccenter\u003e \u003cimg class\u003d\"tex-graphics\" src\u003d\"CDN_BASE_URL/227f9510959cba0802131d2f7b525605?v\u003d1720054425\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e \u003cspan class\u003d\"tex-font-style-sl\"\u003ePicture from Wikimedia Commons\u003c/span\u003e \u003c/center\u003e\u003cp\u003eYou are a middleman in the market. Your job is to determine which ad posters to be accepted such that no two ad posters will occupy the same pixel at the same time. You are given extra $$$m$$$ requests from the ICPC, the $$$k$$$-th of which is that if both the $$$a_k$$$-th ad poster and the $$$b_k$$$-th ad poster are rejected, the ICPC will cancel the whole trade.\u003c/p\u003e\u003cp\u003ePlease determine which ad posters to display such that the trade won\u0027t be canceled, or determine it is impossible.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe input contains only a single case.\u003c/p\u003e\u003cp\u003eThe first line of the input contains three integers $$$n,w$$$ and $$$h$$$ ($$$1 \\leq n \\leq 50\\,000$$$, $$$1\\leq w,h\\leq 2\\,000$$$), denoting the number of ad posters and the size of each ad poster.\u003c/p\u003e\u003cp\u003eIn the next $$$n$$$ lines, the $$$i$$$-th line $$$(1 \\le i \\le n)$$$ contains four integers $$$l_i,r_i,x_i$$$ and $$$y_i$$$ ($$$1\\le l_i\\leq r_i\\leq 2\\,000$$$, $$$1\\leq x_i,y_i\\leq 2\\,000$$$), describing the $$$i$$$-th ad poster.\u003c/p\u003e\u003cp\u003eIn the next line, there contains a single integer $$$m$$$ ($$$0\\leq m\\leq 100\\,000$$$), denoting the number of requests.\u003c/p\u003e\u003cp\u003eIn the next $$$m$$$ lines, the $$$i$$$-th line $$$(1 \\le i \\le m)$$$ contains two integers $$$a_i$$$ and $$$b_i$$$ ($$$1\\leq a_i,b_i\\leq n$$$, $$$a_i\\neq b_i$$$), describing the $$$i$$$-th request.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eIf it is impossible to make such a trade, print a single line containing \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eNo\u003c/span\u003e\". Otherwise, print \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eYes\u003c/span\u003e\" in the first line, then print $$$n$$$ digits in the second line, denoting the solution you find. If the $$$i$$$-th ad poster is accepted, the $$$i$$$-th digit should be \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003e1\u003c/span\u003e\u0027, and if it is rejected, the $$$i$$$-th digit should be \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003e0\u003c/span\u003e\u0027.\u003c/p\u003e\u003cp\u003eIf there is more than one solution, any one of them will be accepted.\u003c/p\u003e"}},{"title":"Examples","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 2 2\n1 2 1 1\n2 3 2 2\n1\n1 2\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYes\n10\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","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 2 2\n1 2 1 1\n1 3 1 2\n2 3 2 2\n3\n1 2\n2 3\n1 3\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eNo\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}