Problem: 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} × 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 ≤ n ≤ 100, 0 ≤ m ≤ min(1000,    (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 ≤ a_{i} ≤ 5000) — number of rooks of color i. In each of next a_{i} lines print two integers x and y (1 ≤ x,    y ≤ 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).

<image>

<image>

<image>

Solution (in JAVA):

Solution:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.FilterInputStream;
import java.io.BufferedInputStream;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Itwazonce
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scan in = new Scan(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CColoredRooks solver = new CColoredRooks();
        solver.solve(1, in, out);
        out.close();
    }

    static class CColoredRooks {
        static ArrayList<Integer>[] array;

        public void solve(int testNumber, Scan in, PrintWriter out) {
            int n = in.scanInt();
            int m = in.scanInt();
            int a[][] = new int[n + m + 100][n + 5];
            int gre[] = new int[n + 1];
            int pair[][] = new int[m + 1][2];
            array = new ArrayList[n + 10];
            for (int i = 1; i <= n; i++) {
                array[i] = new ArrayList<>();
            }
            int last[] = new int[n + m + 10];
            for (int i = 0; i < m; i++) {
                int g = in.scanInt();
                int h = in.scanInt();

                pair[i][0] = g;
                pair[i][1] = h;
                if (g < h) {
                    array[g].add(h);
                    gre[g]++;
                } else {
                    array[h].add(g);
                    gre[h]++;
                }
            }
            int k = 1;
            for (int i = 1; i <= n; i++) {
                for (int j = 0; j < gre[i]; j++) {
                    a[k][i] = i;
                    last[i] = k;
                    a[k][array[i].get(j)] = j + 1;
                    last[array[i].get(j)] = Math.max(array[i].get(j), k);
                    k++;
                }
                a[k][i] = i;
                last[i] = k;
                k++;

            }
            for (int i = 1; i <= n; i++) {
                int count = 0;
                for (int j = 1; j <= last[i]; j++) {
                    if (a[j][i] != 0)
                        count++;
                }
                out.println(count);
                for (int j = 1; j <= last[i]; j++) {
                    if (a[j][i] != 0) {
                        out.println(j + " " + i);
                    }
                }
            }


        }

    }

    static class Scan {
        private byte[] buf = new byte[4 * 1024];
        private int INDEX;
        private BufferedInputStream in;
        private int TOTAL;

        public Scan(InputStream inputStream) {
            in = new BufferedInputStream(inputStream);
        }

        private int scan() {
            if (INDEX >= TOTAL) {
                INDEX = 0;
                try {
                    TOTAL = in.read(buf);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                if (TOTAL <= 0) return -1;
            }
            return buf[INDEX++];
        }

        public int scanInt() {
            int I = 0;
            int n = scan();
            while (isWhiteSpace(n)) n = scan();
            int neg = 1;
            if (n == '-') {
                neg = -1;
                n = scan();
            }
            while (!isWhiteSpace(n)) {
                if (n >= '0' && n <= '9') {
                    I *= 10;
                    I += n - '0';
                    n = scan();
                }
            }
            return neg * I;
        }

        private boolean isWhiteSpace(int n) {
            if (n == ' ' || n == '\n' || n == '\r' || n == '\t' || n == -1) return true;
            else return false;
        }

    }
}