Ivan is a novice painter. He has $n$ dyes of different colors. He also knows exactly $m$ pairs of colors which harmonize with each other.

Ivan also enjoy playing chess. He has $5000$ rooks. He wants to take $k$ rooks, paint each of them in one of $n$ colors and then place this $k$ rooks on a chessboard of size $10^{9} \times 10^{9}$.

Let's call the set of rooks on the board connected if from any rook we can get to any other rook in this set moving only through cells with rooks from this set. Assume that rooks can jump over other rooks, in other words a rook can go to any cell which shares vertical and to any cell which shares horizontal.

Ivan wants his arrangement of rooks to have following properties: For any color there is a rook of this color on a board; For any color the set of rooks of this color is connected; For any two different colors $a$ $b$ union of set of rooks of color $a$ and set of rooks of color $b$ is connected if and only if this two colors harmonize with each other.

Please help Ivan find such an arrangement.


-----Input-----

The first line of input contains $2$ integers $n$, $m$ ($1 \le n \le 100$, $0 \le m \le min(1000, \,\, \frac{n(n-1)}{2})$) — number of colors and number of pairs of colors which harmonize with each other.

In next $m$ lines pairs of colors which harmonize with each other are listed. Colors are numbered from $1$ to $n$. It is guaranteed that no pair occurs twice in this list.


-----Output-----

Print $n$ blocks, $i$-th of them describes rooks of $i$-th color.

In the first line of block print one number $a_{i}$ ($1 \le a_{i} \le 5000$) — number of rooks of color $i$. In each of next $a_{i}$ lines print two integers $x$ and $y$ ($1 \le x, \,\, y \le 10^{9}$) — coordinates of the next rook.

All rooks must be on different cells.

Total number of rooks must not exceed $5000$.

It is guaranteed that the solution exists.


-----Examples-----
Input
3 2
1 2
2 3

Output
2
3 4
1 4
4
1 2
2 2
2 4
5 4
1
5 1

Input
3 3
1 2
2 3
3 1

Output
1
1 1
1
1 2
1
1 3

Input
3 1
1 3

Output
1
1 1
1
2 2
1
3 1



-----Note-----

Rooks arrangements for all three examples (red is color $1$, green is color $2$ and blue is color $3$).

$\left. \begin{array}{|l|l|l|l|l|l|l|} \hline 5 & {} & {} & {} & {} & {} \\ \hline 4 & {} & {} & {} & {} & {} \\ \hline 3 & {} & {} & {} & {} & {} \\ \hline 2 & {} & {} & {} & {} & {} \\ \hline 1 & {} & {} & {} & {} & {} \\ \hline & {1} & {2} & {3} & {4} & {5} \\ \hline \end{array} \right.$

$\left. \begin{array}{|l|l|l|l|} \hline 2 & {} & {} & {} \\ \hline 1 & {} & {} & {} \\ \hline & {1} & {2} & {3} \\ \hline \end{array} \right.$

$\left. \begin{array}{|l|l|l|l|} \hline 2 & {} & {} & {} \\ \hline 1 & {} & {} & {} \\ \hline & {1} & {2} & {3} \\ \hline \end{array} \right.$

Difficulty: interview

Starter code:

Solutions:
n, m = list(map(int, input().split()))
color_pairs = [list(map(int, input().split())) for i in range(m)]
towers = [[(i, i)] for i in range(1, n + 1)]
last_coord = n + 1
for c1, c2 in color_pairs:
    towers[c1 - 1].append((last_coord, c1))
    towers[c2 - 1].append((last_coord, c2))
    last_coord += 1
for i in range(len(towers)):
    print(len(towers[i]))
    for x, y in towers[i]:
        print(x, y)




from collections import defaultdict
n, m = list(map(int, input().split()))
pairs = defaultdict(set)
for _ in range(m):
    l, r = list(map(int, input().split()))
    pairs[l-1].add(r-1)
    pairs[r-1].add(l-1)
answers = defaultdict(list)
free_rooks = defaultdict(int)
y = 1
for color in range(n):
    free_rooks[color] = y
    for c in pairs[color]:
        if c < color:
            answers[color].append((color + 1, free_rooks[c]))
            free_rooks[c] += 1
        else:
            answers[color].append((color + 1, y))
            y += 1
    answers[color].append((color + 1, y))
    y += 1
for color in range(n):
    print(len(answers[color]))
    for x, y in answers[color]:
        print(x, y)


s = input().split()
n = int(s[0])
m = int(s[1])

col = []

for i in range(n):
    col.append([i])
t = n + 1
for i in range(m):
    s = input().split()
    a = int(s[0]) - 1
    b = int(s[1]) - 1
    col[a].append(t)
    col[b].append(t)
    t += 1
for i in range(len(col)):
    print(len(col[i]))
    for j in range(len(col[i])):
        print(i + 1, col[i][j] + 1)
    


cols, pairs = [int(x) for x in input().split()]

import collections
d = collections.defaultdict(list)

for _ in range(pairs):
  a, b = [int(x) for x in input().split()]
  d[a].append(b)
  #d[b].append(a)

rooks = collections.defaultdict(list)
# rooks = [[] for _ in range(cols)]

current_line = 1
for i in range(1, cols+1):

  rooks[i].append((i, current_line))
  current_line += 1

  for harmony in d[i]:
    rooks[i].append((i, current_line))
    rooks[harmony].append((harmony, current_line))
    current_line += 1

for i in range(1, cols+1):
  print(len(rooks[i]))
  for a, b in rooks[i]:
    print(a, b)


3

import math
import sys


DEBUG = False


def inp():
    return sys.stdin.readline().rstrip()


def dprint(*value, sep=' ', end='\n'):
    if DEBUG:
        print(*value, sep=sep, end=end)


def solve(N, M, A):
    ans = [[] for _ in range(N)]
    for i in range(1, N + 1):
        ans[i - 1].append((i, i))

    y = N + 1
    for a in range(1, N + 1):
        for b in range(a + 1, N + 1):
            if A[a][b] == 1:
                ans[a - 1].append((a, y))
                ans[b - 1].append((b, y))
                y += 1

    return ans


def main():
    N, M = [int(e) for e in inp().split()]
    A = [bytearray(N + 1) for _ in range(N + 1)]
    for _ in range(M):
        a, b = [int(e) for e in inp().split()]
        A[a][b] = 1
        A[b][a] = 1

    ans = solve(N, M, A)
    assert len(ans) == N
    for coords in ans:
        print(len(coords))
        for x, y in coords:
            print(x, y)


def __starting_point():
    main()

__starting_point()

n,m = list(map(int, input().split()))
d = {}
for i in range(1,n+1):
    d[i] = set()
for i in range(m):
    x,y = list(map(int, input().split()))
    d[x].add(x*n+y)
    d[y].add(x*n+y)
for i in range(1,n+1):
    print(len(d[i])+1)
    print(i,i)
    for k in d[i]:
        print(i,k)


n,m=map(int,input().split())
harmonies=[]
for i in range(m):
    harmonies.append(list(map(int,input().split())))
spots=[]
for i in range(n):
    yourspots=[]
    for j in range(m):
        if i+1 in harmonies[j]:
            yourspots.append((i+1,j+1))
    yourspots.append((i+1,10000-i))
    spots.append(yourspots)
for i in range(n):
    print(len(spots[i]))
    for j in range(len(spots[i])):
        print(str(spots[i][j][0]),str(spots[i][j][1]))

import math

n,m = list(map(int, input().split()))
hs = []
for _ in range(m):
  a,b = list(map(int, input().split()))
  a -= 1
  b -= 1
  hs.append((min(a,b),max(a,b)))

used = [0]*n
placed = [[] for _ in range(n)]

for (a,b) in hs:
  placed[a].append(b*n + used[b])
  used[b] += 1

for i in range(n):
  print(max(1,used[i])+len(placed[i]))
  for j in range(max(1,used[i])):
    print(i*n + j +1, i+1)
  for j in placed[i]:
    print(j +1, i+1)


import sys
from math import *

def minp():
	return sys.stdin.readline().strip()

def mint():
	return int(minp())

def mints():
	return map(int, minp().split())

n, m = mints()
a = []
p = [None]*n
for i in range(n):
	p[i] = []
for i in range(m):
	x, y = mints()
	p[x-1].append((i+1,x))
	p[y-1].append((i+1,y))
for i in range(n):
	p[i].append((m+1+i,i+1))
for i in range(n):
	print(len(p[i]))
	for j in p[i]:
		print(*j)

n, m = list(map(int, input().split()))
a = {q: [] for q in range(1, n+1)}
for q in range(m):
    x, y = list(map(int, input().split()))
    a[min(x, y)].append(max(y, x))
a = {q: sorted(a[q]) for q in range(1, n+1)}
answer = [[] for q in range(1, n+1)]
q2 = 1
for q in range(1, n+1):
    for q1 in a[q]:
        answer[q1-1].append(q2)
        answer[q-1].append(q2)
        q2 += 1
    answer[q-1].append(q2)
    q2 += 1
for q in range(n):
    print(len(answer[q]))
    for q1 in answer[q]:
        print(q+1, q1)


n, m = map(int, input().split())
a = [[] for i in range(n + 1)]
for i in range(m):
    loc1, loc2 = map(int, input().split())
    a[loc1].append(loc2)
    a[loc2].append(loc1)

k = 1
cvaz = [0] * (n + 1)

for i in range(1, n + 1):
    l = len(a[i])
    print(l + 1)
    print(i, k)
    k += 1
    cvaz[i] = k
    for j in range(l):
        if a[i][j] > i:
            print(i, k)
            k += 1
        else:
            print(i, cvaz[a[i][j]])
            cvaz[a[i][j]] += 1

n,m=[int(el) for el in input().split()]

pair=[]
kol={i:1 for i in range(1,n+1)}

for i in range(m):
    q,w=[int(el) for el in input().split()]
    if q<w:
        pair.append((q,w))
    else:
        q,w=w,q
        pair.append((q,w))
    kol[q]+=1
    kol[w]+=1

pair.sort()

mazy=[]
for i in range(1,n+1):
    mazy.append((i,i,i))

for i in pair:
    mazy.append((i[0],10000*i[1]+i[0],i[0]))
    mazy.append((i[1],10000*i[1]+i[0],i[1]))

mazy.sort()

cur=1
print(kol[1])

while mazy!=[]:
    q=mazy.pop(0)
    if q[0]==cur:
        print(q[1],q[0])
    else:
        print(kol[q[0]])
        print(q[1],q[0])
        cur=q[0]