{"trustable":true,"prependHtml":"\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 async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003eYou are to simulate the movements of an elevator, which works according to the following rules: \u003cbr\u003eThe elevator stays 3 seconds for customers to get in or get out. If some customers want to get in and some want to get out, the elevator stays 6 seconds.\u003cbr\u003e\u003cbr\u003eIt takes the elevator 2 seconds to go one story upwards or downwards.\u003cbr\u003e\u003cbr\u003eWhen there is no request for service, the elevator stays where it is. Namely, it is idle.\u003cbr\u003e\u003cbr\u003eWhen the elevator is idle, and a request comes from upwards or downwards, it moves upwards or downwards. If a request comes from the story where it stays, the elevator opens its door to serve these customers.\u003cbr\u003e\u003cbr\u003eWhen the elevator goes upwards or downwards, it keeps its direction until there is no request from upwards or downwards. However, it breaks off to let customers get out or pick up customers if necessary.\u003cbr\u003e\u003cbr\u003eIf the elevator is to go upwards or downwards, it does not accept customers intending to go upwards or downwards. \u003cbr\u003e\u003cbr\u003eWhen the elevator can act more than one way according to aforementioned rules, it chooses the action with the highest priority. The priorities for actions, from the highest to the lowest, are:\u003cbr\u003e\u003cbr\u003elet customers get out\u003cbr\u003e\u003cbr\u003elet customers get in\u003cbr\u003e\u003cbr\u003ego downstairs\u003cbr\u003e\u003cbr\u003ego upstairs\u003cbr\u003e\u003cbr\u003eInitially (at time 0), the elevator is in the 0th story, and it is idle. Given the requests, you are to output how the elevator moves in a designated interval. Suppose that each request comes at an integer second.\u003cbr\u003e\u003cbr\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The input begins in its first line with the number of stories of a building, and other two numbers representing an interval. These three numbers are separated by a blank.\u003cbr\u003e\u003cbr\u003eEach of the following lines in the input consists of three numbers, N1, N2, and N3, representing a request coming from N2th story to N3th story at time N1.\u003cbr\u003e\u003cbr\u003eA line of three 0\u0027s separates two test cases. After the last test case, there is a line containing three 0\u0027s.\u003cbr\u003e\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"You have to output what the elevator acts at each second in the designated interval. Behind each case should be one blank line\u003cbr\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\u003e5 9 67\r\n10 2 1\r\n13 2 4\r\n21 4 2\r\n26 4 3\r\n40 1 2\r\n45 0 3\r\n46 0 2\r\n0 0 0\r\n0 0 0\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e9: Idle at story 0\r\n10: Going up to 1\r\n11: Going up to 1\r\n12: Going up to 2\r\n13: Going up to 2\r\n14: Let upstair-customers get in at story 2\r\n15: Let upstair-customers get in at story 2\r\n16: Let upstair-customers get in at story 2\r\n17: Going up to 3\r\n18: Going up to 3\r\n19: Going up to 4\r\n20: Going up to 4\r\n21: Let customers get out at story 4\r\n22: Let customers get out at story 4\r\n23: Let customers get out at story 4\r\n24: Let downstair-customers get in at story 4\r\n25: Let downstair-customers get in at story 4\r\n26: Let downstair-customers get in at story 4\r\n27: Going down to 3\r\n28: Going down to 3\r\n29: Let customers get out at story 3\r\n30: Let customers get out at story 3\r\n31: Let customers get out at story 3\r\n32: Going down to 2\r\n33: Going down to 2\r\n34: Let customers get out at story 2\r\n35: Let customers get out at story 2\r\n36: Let customers get out at story 2\r\n37: Let downstair-customers get in at story 2\r\n38: Let downstair-customers get in at story 2\r\n39: Let downstair-customers get in at story 2\r\n40: Going down to 1\r\n41: Going down to 1\r\n42: Let customers get out at story 1\r\n43: Let customers get out at story 1\r\n44: Let customers get out at story 1\r\n45: Going down to 0\r\n46: Going down to 0\r\n47: Let upstair-customers get in at story 0\r\n48: Let upstair-customers get in at story 0\r\n49: Let upstair-customers get in at story 0\r\n50: Going up to 1\r\n51: Going up to 1\r\n52: Let upstair-customers get in at story 1\r\n53: Let upstair-customers get in at story 1\r\n54: Let upstair-customers get in at story 1\r\n55: Going up to 2\r\n56: Going up to 2\r\n57: Let customers get out at story 2\r\n58: Let customers get out at story 2\r\n59: Let customers get out at story 2\r\n60: Going up to 3\r\n61: Going up to 3\r\n62: Let customers get out at story 3\r\n63: Let customers get out at story 3\r\n64: Let customers get out at story 3\r\n65: Idle at story 3\r\n66: Idle at story 3\r\n67: Idle at story 3\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}