{"trustable":false,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n #problem-body \u003e pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n }\n\u003c/style\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv id\u003d\"problem-body\"\u003e\n \u003cp\u003eEveryShit is a systematic person, he lists all of his tasks to be done in a day, where each job is denoted by some integer, in such a way that he gets to know which task is need to be completed before starting with which task. In this task you have to find out whether EveryShit can solve all his duties and if so, print the correct order.\u003c/p\u003e\n \u003cp\u003e\u003cstrong\u003eInput\u003c/strong\u003e\u003c/p\u003e\n \u003cp\u003eIn the first line you are given an integer n and m (1\u0026lt;\u003dn\u0026lt;\u003d10000, 1\u0026lt;\u003dm\u0026lt;\u003d1000000). On the next m lines there are two distinct integers x and y, (1\u0026lt;\u003dx,y\u0026lt;\u003d10000) describing that job x needs to be done before job y.\u003c/p\u003e\n \u003cp\u003e\u003cstrong\u003eOutput\u003c/strong\u003e\u003c/p\u003e\n \u003cp\u003ePrint \"Sandro fails.\" if EveryShit cannot complete all his duties on the list. If there is a solution print the correct ordering, the jobs to be done separated by a whitespace. If there are multiple solutions print the one, whose first number is smallest, if there are still multiple solutions, print the one whose second number is smallest, and so on.\u003c/p\u003e\n \u003cp\u003e\u003cstrong\u003eExample 1\u003c/strong\u003e\u003c/p\u003e\n \u003cpre\u003e\u003cstrong\u003eInput:\u003c/strong\u003e\n8 9\n1 4\n1 2\n4 2\n4 3\n3 2\n5 2\n3 5\n8 2\n8 6\n\n\u003cstrong\u003eOutput:\u003c/strong\u003e\n1 4 3 5 7 8 2 6 \n\u003c/pre\u003e\n \u003cp\u003e\u003cstrong\u003eExample 2\u003c/strong\u003e\u003c/p\u003e\n \u003cpre\u003e\u003cstrong\u003eInput:\u003c/strong\u003e\n2 2\n1 2\n2 1\n\n\u003cstrong\u003eOutput:\u003c/strong\u003e\nSandro fails.\n\u003c/pre\u003e\n\u003c/div\u003e"}}]}