Skip to main content

~/algor $ cat contests/round-5/A

A. Adjacency lists

Problem A ICPC rules 1000 ms 128 MB

An undirected graph with vertices and edges is given. The vertices are numbered from to . For every vertex print its neighbours — the vertices joined to it by an edge — in increasing order.

A graph and the neighbour lists of each of its vertices

Input

The first line contains two integers: and . Each of the next lines contains two positive integers: and — the vertices joined by an edge.

Output

lines: the -th line contains first the number of neighbours of vertex , then the neighbours in increasing order.

Note



,
There is at most one edge between any pair of vertices.

Examples

Input #1
5 5
1 2
1 3
4 1
2 3
3 5
Output #1
3 2 3 4
2 1 3
3 1 2 5
1 1
1 3
Input #2
3 0
Output #2
0
0
0

Sign in to submit a solution

Signing up is free and takes a minute.