{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eThere is an apple tree outside of kaka\u0027s house. Every autumn, a lot of apples will grow in the tree. Kaka likes apple very much, so he has been carefully nurturing the big apple tree. \u003c/p\u003e\u003cp\u003eThe tree has \u003ci\u003eN\u003c/i\u003e forks which are connected by branches. Kaka numbers the forks by 1 to \u003ci\u003eN\u003c/i\u003e and the root is always numbered by 1. Apples will grow on the forks and two apple won\u0027t grow on the same fork. kaka wants to know how many apples are there in a sub-tree, for his study of the produce ability of the apple tree. \u003c/p\u003e\u003cp\u003eThe trouble is that a new apple may grow on an empty fork some time and kaka may pick an apple from the tree for his dessert. Can you help kaka?\u003c/p\u003e\u003cp\u003e\u003c/p\u003e\u003ccenter\u003e\u003cimg src\u003d\"CDN_BASE_URL/95a992a75f75b7d92488d79284d3b4ef?v\u003d1714182839\"\u003e\u003c/center\u003e\u003cp\u003e\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains an integer \u003ci\u003eN\u003c/i\u003e (\u003ci\u003eN\u003c/i\u003e ≤ 100,000) , which is the number of the forks in the tree.\u003cbr\u003eThe following \u003ci\u003eN\u003c/i\u003e - 1 lines each contain two integers \u003ci\u003eu\u003c/i\u003e and \u003ci\u003ev\u003c/i\u003e, which means fork \u003ci\u003eu\u003c/i\u003e and fork \u003ci\u003ev\u003c/i\u003e are connected by a branch.\u003cbr\u003eThe next line contains an integer \u003ci\u003eM\u003c/i\u003e (\u003ci\u003eM\u003c/i\u003e ≤ 100,000).\u003cbr\u003eThe following \u003ci\u003eM\u003c/i\u003e lines each contain a message which is either\u003cbr\u003e\"\u003cb\u003eC \u003ci\u003ex\u003c/i\u003e\u003c/b\u003e\" which means the existence of the apple on fork \u003ci\u003ex\u003c/i\u003e has been changed. i.e. if there is an apple on the fork, then Kaka pick it; otherwise a new apple has grown on the empty fork.\u003cbr\u003eor\u003cbr\u003e\"\u003cb\u003eQ \u003ci\u003ex\u003c/i\u003e\u003c/b\u003e\" which means an inquiry for the number of apples in the sub-tree above the fork \u003ci\u003ex\u003c/i\u003e, including the apple (if exists) on the fork x\u003cbr\u003eNote the tree is full of apples at the beginning\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"For every inquiry, output the correspond answer per line."}},{"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\u003e3\r\n1 2\r\n1 3\r\n3\r\nQ 1\r\nC 2\r\nQ 1\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e3\r\n2\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}