{"trustable":false,"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":"\u003cstyle type\u003d\u0027text/css\u0027\u003e .input, .output {border: 1px solid #888888;} .output {margin-bottom:1em;position:relative;top:-1px;} .output pre,.input pre {background-color:#EFEFEF;line-height:1.25em;margin:0;padding:0.25em;} .title {background-color:#FFFFFF;border-bottom: 1px solid #888888;font-family:arial;font-weight:bold;padding:0.25em;} \u003c/style\u003e \u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027]], displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027]]}\n });\n \u003c/script\u003e\n \u003cscript type\u003d\"text/javascript\" async\n src\u003d\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\"\u003e\n \u003c/script\u003e\n\u003cp\u003e在图灵学校,如果一个学生表现不好,老师就会在他的徽章上打一个洞。今天,老师逮到了\u003ci\u003en\u003c/i\u003e名学生在搞恶作剧。 \u003c/p\u003e\n\u003cp\u003e这些学生从1到n编号。老师先逮到了a学生然后在他的徽章上打了个洞。但是这个学生说带头的是另一个学生\u003ci\u003ep\u003csub\u003ea\u003c/sub\u003e\u003c/i\u003e。\u003c/p\u003e\n\u003cp\u003e于是老师又抓住学生\u003ci\u003ep\u003csub\u003ea\u003c/sub\u003e\u003c/i\u003e在他的徽章上也打了个洞。这个学生又说其实是学生\u003ci\u003ep\u003csub\u003ep\u003csub\u003ea\u003c/sub\u003e\u003c/sub\u003e\u003c/i\u003e在带头搞恶作剧。\u003c/p\u003e\n\u003cp\u003e这个过程一直持续了好一会儿,不过因为这些学生是有限的,最后老师抓住了一个徽章上已经有一个洞的学生。\u003c/p\u003e\n\u003cp\u003e在给这个倒霉孩子的徽章上又打了个洞以后,老师觉得有点累,需要蒸个桑拿于是他就不再继续了。\u003c/p\u003e\n\u003cp\u003e你不知道谁是老师逮到的第一个学生,但是你知道所有的数字\u003ci\u003ep\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e。对于每一个a,如果第一个被逮到的学生是a,你的任务是找到谁会是徽章上面有两个洞的学生。\u003c/p\u003e"}},{"title":"输入格式","value":{"format":"HTML","content":"\u003cp\u003e第一行只有一个数字 n (1 \u003c\u003d n \u003c\u003d1000)\u0026nbsp;,表示搞恶作剧的学生的人数。\u003c/p\u003e\n\u003cp\u003e第二行有n个数字,\u003ci\u003ep\u003csub\u003e1\u003c/sub\u003e\u003c/i\u003e, ..., \u003ci\u003ep\u003csub\u003en\u003c/sub\u003e\u003c/i\u003e (1\u003c\u003d \u003ci\u003ep\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e \u003c\u003d n), \u003ci\u003ep\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e表示被学生i指认是带头搞恶作剧的学生的编号。\u003c/p\u003e"}},{"title":"输出格式","value":{"format":"HTML","content":"\u003cp\u003e对从1 到 n之间的每个学生 a,如果a是第一个被抓到的学生,输出谁会是徽章上面有两个洞的学生。\u003c/p\u003e"}},{"title":"输入输出样例","value":{"format":"HTML","content":"\u003cdiv class\u003d\"sample-test\"\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e3\u003cbr\u003e2 3 2\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003e2 2 3 \u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e3\u003cbr\u003e1 2 3\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003e1 2 3 \u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}},{"title":"样例说明","value":{"format":"HTML","content":"\u003cp\u003e本图说明第一个样例.\u003c/p\u003e\n\u003ccenter\u003e \n \u003cimg class\u003d\"tex-graphics\" SRC\u003d\"CDN_BASE_URL/e6b01184c308524dcc6e9aca5770da3a?v\u003d1547022767\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e \n\u003c/center\u003e\n\u003cp\u003e当a \u003d 1, 老师的打洞顺序是1-\u003e2-\u003e3-\u003e2,输出2(2的徽章上会有俩洞);\u003c/p\u003e\n\u003cp\u003e当a \u003d 2, 老师的打洞顺序是 2-\u003e3-\u003e2,输出2; 当a \u003d 3,老师的打洞顺序是3-\u003e2-\u003e3,输出3。\u003c/p\u003e\n\u003cp\u003e对于第二个样例,不管老师先逮到谁,这个第一个被老师逮到的倒霉孩子将会得到两个洞。\u003c/p\u003e"}}]}