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.OutputStream;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.TreeMap;
import java.io.InputStream;

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

    static class TaskC {
        public void solve(int testNumber, FastReader in, PrintWriter out) {
            Debug debug = new Debug();
            int n = in.nextInt();
            int m = in.nextInt();
            DJSet djSet = new DJSet(n);
            int[] deg = new int[n];
            TaskC.Pair[] pairs = new TaskC.Pair[m];
            for (int i = 0; i < m; ++i) {
                int u = in.nextInt() - 1;
                int v = in.nextInt() - 1;
                djSet.union(u, v);
                ++deg[u];
                ++deg[v];
                pairs[i] = new TaskC.Pair(u, v);
            }
            for (int i = 0; i < n; ++i) deg[i] = Math.max(deg[i], 1);
            TreeMap<Integer, ArrayList<TaskC.Pair>> map = new TreeMap<>();
            int r = 1;
            int c = 1;
            for (int i = 0; i < n; ++i) {
                ArrayList<TaskC.Pair> list = new ArrayList<>();
                for (int j = 0; j < deg[i]; ++j) list.add(new TaskC.Pair(r, c++));
                ++r;
                map.put(i, list);
            }
//        debug.tr(map);
            for (TaskC.Pair cur : pairs) {
                int i = cur.r;
                int j = cur.c;

                ArrayList<TaskC.Pair> l1 = map.get(i);
                ArrayList<TaskC.Pair> l2 = map.get(j);

                int r1 = l1.get(0).r;
                int r2 = l2.get(0).r;

                int c1 = l1.get(0).c + deg[i] - 1;
                int c2 = l2.get(0).c + deg[j] - 1;
                --deg[i];
                --deg[j];

                l2.add(new TaskC.Pair(r2, c1));
                l1.add(new TaskC.Pair(r1, c2));
//            debug.tr(r2, c1, r1, c2);
                map.put(i, l1);
                map.put(j, l2);
            }
//        debug.tr(map);
            for (Integer key : map.keySet()) {
                ArrayList<TaskC.Pair> cur = map.get(key);
                out.println(cur.size());
                for (TaskC.Pair pp : cur) out.println(pp.toString());
            }
        }

        static class Pair {
            int r;
            int c;

            public Pair(int r, int c) {
                this.r = r;
                this.c = c;
            }

            public String toString() {
                return r + " " + c;
            }

        }

    }

    static class Debug {
        PrintWriter out;
        boolean oj;
        boolean system;
        long timeBegin;
        Runtime runtime;

        public Debug(PrintWriter out) {
            oj = System.getProperty("ONLINE_JUDGE") != null;
            this.out = out;
            this.timeBegin = System.currentTimeMillis();
            this.runtime = Runtime.getRuntime();
        }

        public Debug() {
            system = true;
            oj = System.getProperty("ONLINE_JUDGE") != null;
            OutputStream outputStream = System.out;
            this.out = new PrintWriter(outputStream);
            this.timeBegin = System.currentTimeMillis();
            this.runtime = Runtime.getRuntime();
        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar;
        private int pnumChars;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        private int pread() {
            if (pnumChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= pnumChars) {
                curChar = 0;
                try {
                    pnumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (pnumChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = pread();
            while (isSpaceChar(c))
                c = pread();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = pread();
            }
            int res = 0;
            do {
                if (c == ',') {
                    c = pread();
                }
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = pread();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }

    static class DJSet {
        public int[] upper;
        public int count;

        public DJSet(int n) {
            upper = new int[n];
            count = n;
            Arrays.fill(upper, -1);
        }

        public int root(int x) {
            return upper[x] < 0 ? x : (upper[x] = root(upper[x]));
        }

        public boolean union(int x, int y) {
            x = root(x);
            y = root(y);
            if (x != y) {
                if (upper[y] < upper[x]) {
                    int d = x;
                    x = y;
                    y = d;
                }
                upper[x] += upper[y];
                upper[y] = x;
                --count;
                return true;
            }
            return false;
        }

    }
}