{"trustable":true,"sections":[{"title":"Description","value":{"format":"MD","content":"实现一个数据结构,维护一张表(最初只有一个元素 $1$)。需要支持下面的操作,其中 $x$ 和 $y$ 都是 $1$ 到 $10^6$ 范围内的正整数,且保证任何时间表中所有数字均不相同,操作数量不多于 $10^5$:\n\n- `1 x y` :将元素 $y$ 插入到 $x$ 后面;\n- `2 x` :询问 $x$ 后面的元素是什么。如果 $x$ 是最后一个元素,则输出 $0$;\n- `3 x`:从表中删除元素 $x$ **后面的那个元素**,不改变其他元素的先后顺序。\n\n\n\n"}},{"title":"Input","value":{"format":"MD","content":"第一行一个整数 $q$ 表示操作次数。\n\n接下来 $q$ 行,每行表示一次操作,操作具体间题目描述。"}},{"title":"Output","value":{"format":"MD","content":"对于每个操作 2,输出一个数字,用换行隔开。"}},{"title":"Sample 1","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\u003e6\n1 1 99\n1 99 50\n1 99 75\n2 99\n3 75\n2 1\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e75\n99\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}