{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eUsatiy-Polosatiy XIII decided to destroy Anansi\u0027s home\u0026nbsp;— his cobweb.\r\nThe cobweb consists of \u003ci\u003eN\u003c/i\u003e nodes, some of which are connected by threads.\r\nLet us say that two nodes belong to the same piece if it is possible to get from one node to the other by threads. Usatiy-Polosatiy has already decided which threads and in what order he would tear and now wants to know the number of pieces in cobweb after each of his actions.\u003c/div\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eThe first line contains integers \u003ci\u003eN\u003c/i\u003e and \u003ci\u003eM\u003c/i\u003e\u0026nbsp;— the number of nodes and threads in the cobweb, respectively\u003cnobr\u003e(2 ≤ \u003ci\u003eN\u003c/i\u003e ≤ 100000;\u003c/nobr\u003e \u003cnobr\u003e1 ≤ \u003ci\u003eM\u003c/i\u003e ≤ 100000)\u003c/nobr\u003e. Each of the next \u003ci\u003eM\u003c/i\u003e lines contains two different integers\u0026nbsp;— the 1-based indices of nodes connected by current thread. The threads are numbered from 1 to \u003ci\u003eM\u003c/i\u003e in the order of description. Next line contains an integer \u003ci\u003eQ\u003c/i\u003e which denotes the quantity of threads Usatiy-Polosatiy wants to tear \u003cnobr\u003e(1 ≤ \u003ci\u003eQ\u003c/i\u003e ≤ \u003ci\u003eM\u003c/i\u003e)\u003c/nobr\u003e. The last line contains numbers of these threads\u0026nbsp;— different integers separated by spaces.\u003c/div\u003e\u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eOutput \u003ci\u003eQ\u003c/i\u003e integers\u0026nbsp;— the number of pieces in Anansi\u0027s cobweb after each of Usatiy-Polosatiy\u0027s action. Separate numbers with single spaces.\u003c/div\u003e\u003c/div\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\u003e4 4\r\n1 2\r\n2 3\r\n1 3\r\n3 4\r\n3\r\n2 4 3\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1 2 3\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003cbr\u003e\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 1\r\n1 2\r\n1\r\n1\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e3\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}