{"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 organizers of a programming contest have decided to present t-shirts to participants. There are six different t-shirts sizes in this problem: \u003cspan class\u003d\"tex-font-style-tt\"\u003eS\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003eM\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003eL\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003eXL\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003eXXL\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003eXXXL\u003c/span\u003e (sizes are listed in increasing order). The t-shirts are already prepared. For each size from \u003cspan class\u003d\"tex-font-style-tt\"\u003eS\u003c/span\u003e to \u003cspan class\u003d\"tex-font-style-tt\"\u003eXXXL\u003c/span\u003e you are given the number of t-shirts of this size.\u003c/p\u003e\u003cp\u003eDuring the registration, the organizers asked each of the \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e participants about the t-shirt size he wants. If a participant hesitated between two sizes, he could specify two neighboring sizes\u0026nbsp;— this means that any of these two sizes suits him.\u003c/p\u003e\u003cp\u003eWrite a program that will determine whether it is possible to present a t-shirt to each participant of the competition, or not. Of course, each participant should get a t-shirt of proper size: \u003c/p\u003e\u003cul\u003e \u003cli\u003e the size he wanted, if he specified one size; \u003c/li\u003e\u003cli\u003e any of the two neibouring sizes, if he specified two sizes. \u003c/li\u003e\u003c/ul\u003e\u003cp\u003eIf it is possible, the program should find any valid distribution of the t-shirts.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line of the input contains six non-negative integers\u0026nbsp;— the number of t-shirts of each size. The numbers are given for the sizes \u003cspan class\u003d\"tex-font-style-tt\"\u003eS\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003eM\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003eL\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003eXL\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003eXXL\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003eXXXL\u003c/span\u003e, respectively. The total number of t-shirts doesn\u0027t exceed \u003cspan class\u003d\"tex-span\"\u003e100 000\u003c/span\u003e.\u003c/p\u003e\u003cp\u003eThe second line contains positive integer \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e (\u003cspan class\u003d\"tex-span\"\u003e1 ≤ \u003ci\u003en\u003c/i\u003e ≤ 100 000\u003c/span\u003e)\u0026nbsp;— the number of participants.\u003c/p\u003e\u003cp\u003eThe following \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e lines contain the sizes specified by the participants, one line per participant. The \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ei\u003c/i\u003e\u003c/span\u003e-th line contains information provided by the \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ei\u003c/i\u003e\u003c/span\u003e-th participant: single size or two sizes separated by comma (without any spaces). If there are two sizes, the sizes are written in increasing order. It is guaranteed that two sizes separated by comma are neighboring.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eIf it is not possible to present a t-shirt to each participant, print «\u003cspan class\u003d\"tex-font-style-tt\"\u003eNO\u003c/span\u003e» (without quotes).\u003c/p\u003e\u003cp\u003eOtherwise, print \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e + 1\u003c/span\u003e lines. In the first line print «\u003cspan class\u003d\"tex-font-style-tt\"\u003eYES\u003c/span\u003e» (without quotes). In the following \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e lines print the t-shirt sizes the orginizers should give to participants, one per line. The order of the participants should be the same as in the input.\u003c/p\u003e\u003cp\u003eIf there are multiple solutions, print any of them.\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\u003e0 1 0 1 1 0\n3\nXL\nS,M\nXL,XXL\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYES\nXL\nM\nXXL\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\u003e1 1 2 0 1 1\n5\nS\nM\nS,M\nXXL,XXXL\nXL,XXL\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"}}]}