#include<bits/stdc++.h> #define SINGLE_INPUT #define ll long long #define ull unsigned long long #define N 500005 #define MOD 998244353 usingnamespace std;
voidsol(){ int n, m; cin >> n >> m; vector<vector<int>> g(n + 1); for (int i = 1; i <= n; i++) { g[i].push_back(i); } for (int i = n + 1; i <= n + m; i++) { int x, y; cin >> x >> y; g[x].push_back(i); g[y].push_back(i); } for (int i = 1; i <= n; i++) { cout << g[i].size() << "\n"; for (int j : g[i]) { cout << j << " " << i << "\n"; } } }