Given an undirected graph , any induces a subgraph , where contains all edges in that join two vertices in . Let denote the minimum degree of the vertices in .
You are given a graph and a size . Which is the maximum degree for which there exists some with at least vertices and such that ?
Input consists of several cases, each with the number of vertices , the number of edges , and pairs (with ), one for each edge of the graph, followed by . The vertices are numbered from 0 to . Assume , , that there are no repeated edges, and .
For every case, print the required answer.
Input
6 6 0 1 1 2 2 0 0 3 1 4 2 5 3 6 6 0 1 1 2 2 0 0 3 1 4 2 5 4 2 1 1 0 2 2 0 2 3 2 0 1 0 2 2
Output
2 1 1 0 1