CF976F Minimal k-covering

Description

You are given a bipartite graph $ G=(U,V,E) $ , $ U $ is the set of vertices of the first part, $ V $ is the set of vertices of the second part and $ E $ is the set of edges. There might be multiple edges. Let's call some subset of its edges ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF976F/30cca9ec3414b2cdaa4736468f021199a0e40953.png) $ k $ -covering iff the graph ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF976F/d49bf4cc25f3533c586c660e8b21a303cdd43d12.png) has each of its vertices incident to at least $ k $ edges. Minimal $ k $ -covering is such a $ k $ -covering that the size of the subset ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF976F/30cca9ec3414b2cdaa4736468f021199a0e40953.png) is minimal possible. Your task is to find minimal $ k $ -covering for each ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF976F/06fc521a2ce350cb8a0dd7acf79829b13f12656e.png), where $ minDegree $ is the minimal degree of any vertex in graph $ G $ .

Input Format

The first line contains three integers $ n_{1} $ , $ n_{2} $ and $ m $ ( $ 1

Output Format

For each ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF976F/06fc521a2ce350cb8a0dd7acf79829b13f12656e.png) print the subset of edges (minimal $ k $ -covering) in separate line. The first integer $ cnt_{k} $ of the $ k $ -th line is the number of edges in minimal $ k $ -covering of the graph. Then $ cnt_{k} $ integers follow — original indices of the edges which belong to the minimal $ k $ -covering, these indices should be pairwise distinct. Edges are numbered $ 1 $ through $ m $ in order they are given in the input.