{"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\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eGennady is one of the best child dentists in Berland. Today \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e children got an appointment with him, they lined up in front of his office.\u003c/p\u003e\u003cp\u003eAll children love to cry loudly at the reception at the dentist. We enumerate the children with integers from \u003cspan class\u003d\"tex-span\"\u003e1\u003c/span\u003e to \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e in the order they go in the line. Every child is associated with the value of his \u003cspan class\u003d\"tex-font-style-it\"\u003ecofidence\u003c/span\u003e \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ep\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e\u003c/span\u003e. The children take turns one after another to come into the office; each time the child that is the first in the line goes to the doctor.\u003c/p\u003e\u003cp\u003eWhile Gennady treats the teeth of the \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ei\u003c/i\u003e\u003c/span\u003e-th child, the child is crying with the volume of \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ev\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e\u003c/span\u003e. At that the \u003cspan class\u003d\"tex-font-style-it\"\u003econfidence\u003c/span\u003e of the first child in the line is reduced by the amount of \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ev\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e\u003c/span\u003e, the second one — by value \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ev\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e - 1\u003c/span\u003e, and so on. The children in the queue after the \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ev\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e\u003c/span\u003e-th child almost do not hear the crying, so their \u003cspan class\u003d\"tex-font-style-it\"\u003econfidence\u003c/span\u003e remains unchanged.\u003c/p\u003e\u003cp\u003eIf at any point in time the \u003cspan class\u003d\"tex-font-style-it\"\u003econfidence\u003c/span\u003e of the \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ej\u003c/i\u003e\u003c/span\u003e-th child is less than zero, he begins to cry with the volume of \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ed\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e\u003ci\u003ej\u003c/i\u003e\u003c/sub\u003e\u003c/span\u003e and leaves the line, running towards the exit, without going to the doctor\u0027s office. At this the \u003cspan class\u003d\"tex-font-style-it\"\u003econfidence\u003c/span\u003e of all the children after the \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ej\u003c/i\u003e\u003c/span\u003e-th one in the line is reduced by the amount of \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ed\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e\u003ci\u003ej\u003c/i\u003e\u003c/sub\u003e\u003c/span\u003e.\u003c/p\u003e\u003cp\u003eAll these events occur immediately one after the other in some order. Some cries may lead to other cries, causing a chain reaction. Once in the hallway it is quiet, the child, who is first in the line, goes into the doctor\u0027s office.\u003c/p\u003e\u003cp\u003eHelp Gennady the Dentist to determine the numbers of kids, whose teeth he will cure. Print their numbers in the chronological order.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line of the input contains a 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 ≤ 4000\u003c/span\u003e) — the number of kids in the line. \u003c/p\u003e\u003cp\u003eNext \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e lines contain three integers each \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ev\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e, \u003ci\u003ed\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e, \u003ci\u003ep\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e\u003c/span\u003e (\u003cspan class\u003d\"tex-span\"\u003e1 ≤ \u003ci\u003ev\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e, \u003ci\u003ed\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e, \u003ci\u003ep\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e ≤ 10\u003csup class\u003d\"upper-index\"\u003e6\u003c/sup\u003e\u003c/span\u003e) — the volume of the cry in the doctor\u0027s office, the volume of the cry in the hall and the \u003cspan class\u003d\"tex-font-style-it\"\u003econfidence\u003c/span\u003e of the \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ei\u003c/i\u003e\u003c/span\u003e-th child.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eIn the first line print number \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ek\u003c/i\u003e\u003c/span\u003e — the number of children whose teeth Gennady will cure.\u003c/p\u003e\u003cp\u003eIn the second line print \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ek\u003c/i\u003e\u003c/span\u003e integers — the numbers of the children who will make it to the end of the line in the increasing order.\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\u003e5\n4 2 2\n4 1 2\n5 2 4\n3 3 5\n5 1 2\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\n1 3 \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\u003e5\n4 5 1\n5 3 9\n4 1 2\n2 1 8\n4 1 9\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e4\n1 2 4 5 \u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eIn the first example, Gennady first treats the teeth of the first child who will cry with volume \u003cspan class\u003d\"tex-span\"\u003e4\u003c/span\u003e. The confidences of the remaining children will get equal to \u003cspan class\u003d\"tex-span\"\u003e - 2, 1, 3, 1\u003c/span\u003e, respectively. Thus, the second child also cries at the volume of \u003cspan class\u003d\"tex-span\"\u003e1\u003c/span\u003e and run to the exit. The confidence of the remaining children will be equal to \u003cspan class\u003d\"tex-span\"\u003e0, 2, 0\u003c/span\u003e. Then the third child will go to the office, and cry with volume \u003cspan class\u003d\"tex-span\"\u003e5\u003c/span\u003e. The other children won\u0027t bear this, and with a loud cry they will run to the exit.\u003c/p\u003e\u003cp\u003eIn the second sample, first the first child goes into the office, he will cry with volume \u003cspan class\u003d\"tex-span\"\u003e4\u003c/span\u003e. The confidence of the remaining children will be equal to \u003cspan class\u003d\"tex-span\"\u003e5, - 1, 6, 8\u003c/span\u003e. Thus, the third child will cry with the volume of \u003cspan class\u003d\"tex-span\"\u003e1\u003c/span\u003e and run to the exit. The confidence of the remaining children will be equal to \u003cspan class\u003d\"tex-span\"\u003e5, 5, 7\u003c/span\u003e. After that, the second child goes to the office and cry with the volume of \u003cspan class\u003d\"tex-span\"\u003e5\u003c/span\u003e. The confidences of the remaining children will be equal to \u003cspan class\u003d\"tex-span\"\u003e0, 3\u003c/span\u003e. Then the fourth child will go into the office and cry with the volume of \u003cspan class\u003d\"tex-span\"\u003e2\u003c/span\u003e. Because of this the confidence of the fifth child will be \u003cspan class\u003d\"tex-span\"\u003e1\u003c/span\u003e, and he will go into the office last.\u003c/p\u003e"}}]}