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.*;
import java.util.*;

public class C implements Runnable {
	public static void main (String[] args) {new Thread(null, new C(), "_cf", 1 << 28).start();}

	public void run() {
		FastScanner fs = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		System.err.println("");

		int n = fs.nextInt();
		myBitSet[] adj = new myBitSet[n];
		for(int i = 0; i < n; i++) adj[i] = new myBitSet(n+1);
		int m = fs.nextInt();
		for(int i = 0; i < m; i++) {
			int u = fs.nextInt()-1, v = fs.nextInt()-1;
			adj[u].set(v);
			adj[v].set(u);
		}

		int[][] res = new int[2000][2000];
		int[] freq2 = new int[2000];
		int[] freq = new int[n+1];
		int[][] where = new int[n][2000];
		myBitSet[] sets = new myBitSet[2000];
		for(int i = 0; i < 2000; i++) sets[i] = new myBitSet(n+1);
		
		res[0][0] = 1;
		sets[0].set(0);
		freq2[0]++;
		where[0][0]++;
		freq[0]++;
		for(int i = 0; i < n; i++) {
			if(freq[i] == 0) { //find first empty column
				boolean fnd = false;
				for(int j = 0; j < 2000; j++) {
					if(freq2[j] == 0) {
						res[i][j] = i+1;
						freq2[j]++;
						freq[i]++;
						where[i][j]++;
						sets[j].set(i);
						fnd = true;
						break;
					}
				}
				if(!fnd) throw new RuntimeException();
			}
			//solve all your kids
			for(int j = i+1; j < n; j++) if(adj[i].isSet(j)) {
				boolean fnd = false;
				for(int k = 0; k < 2000; k++) {
					//can it go here?
					//only if j is adjacent to everyone in this column
					int size = sets[k].andC(adj[j]);
					int size2 = sets[k].andC(adj[i]);
					if(size == sets[k].size() && size2 == sets[k].size()) {
						sets[k].set(j);
						sets[k].set(i);
						
						freq2[k]++;
						freq[j]++;
						
						res[j][k] = j+1;
						where[j][k]++;
						
						res[i][k] = i+1;
						where[i][k]++;
						fnd = true;
						break;
					}
				}
				if(!fnd) throw new RuntimeException();
			}
			
		}

		ArrayList<int[]>[] list = new ArrayList[n+1];
		for(int i = 0; i < n+1; i++) list[i] = new ArrayList<int[]>();
		int sz = 0;
		for(int i = 0; i < 2000; i++) {
			for(int j = 0; j < 2000; j++) {
				if(res[i][j] == 0) continue;
				sz++;
//				System.out.println("! " + i + " " + j);
				list[res[i][j]].add(new int[] {i+1, j+1});
			}
		}
		
		if(sz > 5000) throw new RuntimeException("!");

		for(int i = 1; i <= n; i++) {
			out.println(list[i].size());
			for(int[] e :list[i]) {
				out.println(e[1] + " " + e[0]);
			}
		}
		
		out.close();
	}
	
	class myBitSet {
		long[] bits;
		int n, m;
		myBitSet(int nn) {
			n = nn;
			m = nn/60 + (nn % 60 > 0 ? 1 : 0);
			bits = new long[m];
		}
		void set(int i) {
			int idx = i/60;
			int bit = i-idx*60;
			bits[idx] |= 1L << bit;
		}
		int size() {
			int res = 0;
			for(int j = 0; j < bits.length; j++) res += Long.bitCount(bits[j]);
			return res;
		}
		int andC(myBitSet b) {
			int res = 0;
			for(int i = 0; i < bits.length; i++) {
				long temp = bits[i] & b.bits[i];
				res += Long.bitCount(temp);
			}
			return res;
		}
		boolean isSet(int i) {
			int idx = i/60;
			int bit = i-idx*60;
			return (bits[idx] & (1L<<bit)) > 0;
		}
	}
	
	class Point {
		int x, y, color;
		Point(int a, int b, int c) {
			x = a; y = b;
			color = c;
		}
	}

	class FastScanner {
		public int BS = 1<<16;
		public char NC = (char)0;
		byte[] buf = new byte[BS];
		int bId = 0, size = 0;
		char c = NC;
		double num = 1;
		BufferedInputStream in;

		public FastScanner() {
			in = new BufferedInputStream(System.in, BS);
		}

		public FastScanner(String s) {
			try {
				in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
			}
			catch (Exception e) {
				in = new BufferedInputStream(System.in, BS);
			}
		}

		public char nextChar(){
			while(bId==size) {
				try {
					size = in.read(buf);
				}catch(Exception e) {
					return NC;
				}                
				if(size==-1)return NC;
				bId=0;
			}
			return (char)buf[bId++];
		}

		public int nextInt() {
			return (int)nextLong();
		}

		public long nextLong() {
			num=1;
			boolean neg = false;
			if(c==NC)c=nextChar();
			for(;(c<'0' || c>'9'); c = nextChar()) {
				if(c=='-')neg=true;
			}
			long res = 0;
			for(; c>='0' && c <='9'; c=nextChar()) {
				res = (res<<3)+(res<<1)+c-'0';
				num*=10;
			}
			return neg?-res:res;
		}

		public double nextDouble() {
			double cur = nextLong();
			return c!='.' ? cur:cur+nextLong()/num;
		}

		public String next() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c>32) {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public String nextLine() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c!='\n') {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public boolean hasNext() {
			if(c>32)return true;
			while(true) {
				c=nextChar();
				if(c==NC)return false;
				else if(c>32)return true;
			}
		}
		
		public int[] nextIntArray(int n) {
			int[] res = new int[n];
			for(int i = 0; i < n; i++) res[i] = nextInt();
			return res;
		}
		
	}

}