#P1692. Tribal Defense

    ID: 14977 Type: Default 1000ms 256MiB

Tribal Defense

Tribal Defense

The residents of the original tribe (\text{byteland}) are frequently in conflicts over limited resources, and nearly every resident has an enemy. The tribe chief wants to select as many residents as possible for the defense team such that any two chosen residents are not enemies. Given the enemy relationships among the residents, compute the optimal scheme to form the defense team. If there are multiple optimal schemes, output the lexicographically largest one, where the scheme is represented as a sorted (in increasing order) list of resident identifiers and lexicographical order is defined as comparing these lists element-wise.

inputFormat

The first line contains two integers (n) and (m), representing the number of residents and the number of enemy pairs respectively. Each of the next (m) lines contains two integers (u) and (v) ((1 \le u, v \le n)), indicating that resident (u) and resident (v) are enemies.

outputFormat

Output two lines. The first line contains an integer denoting the maximum number of residents in the defense team. The second line contains the chosen residents' identifiers in increasing order, separated by a space. If there are multiple optimal solutions, output the lexicographically largest scheme.

sample

3 2
1 2
2 3
2

1 3

</p>