{"trustable":true,"prependHtml":"\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eThe 44th World Finals of the International Collegiate Programming Contest (ICPC 2020) will be held in Moscow, Russia. To celebrate this annual event for the best competitive programmers around the world, it is decided to host a welcome party for all $n$ participants of the World Finals, numbered from $1$ to $n$ for convenience.\u003c/p\u003e\n\n\u003cp\u003eThe party will be held in a large hall. For security reasons, all participants must present their badge to the staff and pass a security check in order to be admitted into the hall. Due to the lack of equipment to perform the security check, it is decided to open only one entrance to the hall, and therefore only one person can enter the hall at a time.\u003c/p\u003e\n\n\u003cp\u003eSome participants are friends with each other. There are $m$ pairs of mutual friendship relations. Needless to say, parties are more fun with friends. When a participant enters the hall, if he or she finds that none of his or her friends is in the hall, then that participant will be unhappy, even if his or her friends will be in the hall later. So, one big problem for the organizer is the order according to which participants enter the hall, as this will determine the number of unhappy participants. You are asked to find an order that minimizes the number of unhappy participants. Because participants with smaller numbers are more important (for example the ICPC director may get the number 1), if there are multiple such orders, you need to find the lexicographically smallest one, so that important participants enter the hall first.\u003c/p\u003e\n\n\u003cp\u003ePlease note that if participant $a$ and $b$ are friends, and if participant $b$ and $c$ are friends, it\u0027s NOT necessary that participant $a$ and $c$ are friends.\u003c/p\u003e\n\n\u003ch4\u003eInput\u003c/h4\u003e\n\u003cp\u003eThere are multiple test cases. The first line of the input contains a positive integer $T$, indicating the number of cases. For each test case:\u003c/p\u003e\n\n\u003cp\u003eThe first line contains two integers $n$ and $m$ ($1 \\le n,m \\le 10^6$), the number of participants and the number of friendship relations.\u003c/p\u003e\n\n\u003cp\u003eThe following $m$ lines each contains two integers $a$ and $b$ ($1 \\le a,b \\le n, a \\neq b$), indicating that the $a$-th and the $b$-th participant are friends. Each friendship pair is only described once in the input.\u003c/p\u003e\n\n\u003cp\u003eIt is guaranteed that neither the sum of $n$ nor the sum of $m$ of all cases will exceed $10^6$.\u003c/p\u003e\n\n\u003ch4\u003eOutput\u003c/h4\u003e\n\u003cp\u003eFor each case, print a single integer on the first line, indicating the minimum number of unhappy participants. On the second line, print a permutation of $1$ to $n$ separated by a space, indicating the lexicographically smallest ordering of participants entering the hall that achieves this minimum number.\u003c/p\u003e\n\n\u003cp\u003eConsider two orderings $P \u003d p_1, p_2, \\dots, p_n$ and $Q \u003d q_1, q_2, \\dots, q_n$, we say $P$ is lexicographically smaller than $Q$, if there exists an integer $k$ ($1 \\le k \\le n$), such that $p_i \u003d q_i$ holds for all $1 \\le i \u0026lt; k$, and $p_k \u0026lt; q_k$.\u003c/p\u003e\n\n\u003cp\u003ePlease, DO NOT output extra spaces at the end of each line, or your solution may be considered incorrect!\u003c/p\u003e\n\n\u003ch4\u003eSample\u003c/h4\u003e\n\u003ctable class\u003d\"vjudge_sample\"\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\u003e2\n4 3\n1 2\n1 3\n1 4\n4 2\n1 2\n3 4\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\n1 2 3 4\n2\n1 2 3 4\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\n"}}]}