Problem Description
A two-party system is a form of party system where two major political parties dominate voting in nearly all elections, at every level. As a result, all, or nearly all, elected offices end up being held by candidates endorsed by one of the two major parties.Under a two-party system, one of the two parties typically holds a plurality in the legislature , and is referred to as the majority party. The smaller party is referred to as the minority party. Two-party systems are most common in polities with plurality vote counting system to prevent the problem of two similar candidates "splitting" the same voters.
There is a small country under a two-party system, the two parties are party A and party B. Every time when parliament convened, members of both parties will submit Their proposals. Some of the proposals will be raised by some members of the same party, but each person can submit only one. Of course, some people may object to certain proposals of the other party. If a member's proposal is adopted and all his objection cases are not adopted, then he will be pleased. As the country's president, you can arrange these proposals is adopted or not. You want to know , to make the numnber of people pleased with your decision maximum, which proposals must be adopted ?

Input
On the first line one positive number: the number of testcases. After that per testcase:One line with three integers a, b, n (0<=a,b<=100 and 0<=n<=200): the number of proposals by party A, by party B, and number of members of the parliament. The proposals are numbered from 1 to a+b, the first a are party A's, the latter b are party B's.
n lines follow, each line represents a member of the parliament, begin with two integers ri,mi(1<=ri<=a+b, 0<=mi<a+b): the proposal submit by him, the number of proposals he object to. And then follows mi integers indicate the proposal he object to.

Output
For each test case, you should output 2 lines. The first line will contains one integer, the maxium number of people pleased. The second line begins with an integer x, indicates there are x proposals must be adopted. Then output the x proposals in ascending order of their id. There is a space between each two proposals.

Sample Input
3
2 1 3
1 0
1 0
3 0
2 1 3
1 0
2 1 3
3 0
2 1 4
1 0
1 1 3
2 0
3 2 1 2

Sample Output
3
2 1 3
2
1 1
3
2 1 2

20道你必须要背会的微服务面试题，面试一定会被问到

Windows可谓是大多数人的生产力工具，集娱乐办公于一体，虽然在程序员这个群体中都说苹果是信仰，但是大部分不都是从Windows过来的，而且现在依然有很多的程序员用Windows。 所以，今天我就把我私藏的Windows必装的软件分享给大家，如果有一个你没有用过甚至没有听过，那你就赚了????，这可都是提升你幸福感的高效率生产力工具哦！ 走起！???? NO、1 ScreenToGif 屏幕，摄像头和白板...

2020 年，大火的 Python 和 JavaScript 是否会被取而代之？
Python 和 JavaScript 是目前最火的两大编程语言，但是2020 年，什么编程语言将会取而代之呢？ 作者 |Richard Kenneth Eng 译者 |明明如月，责编 | 郭芮 出品 | CSDN（ID：CSDNnews） 以下为译文： Python 和 JavaScript 是目前最火的两大编程语言。然而，他们不可能永远屹立不倒。最终，必将像其他编程语言一...

Flutter 会不会被苹果限制其发展?

Idea 中最常用的10款插件（提高开发效率），一定要学会使用！

AI 没让人类失业，搞 AI 的人先失业了

2020年，冯唐49岁：我给20、30岁IT职场年轻人的建议

B站是个宝，谁用谁知道???? 作为一名大学生，你必须掌握的一项能力就是自学能力，很多看起来很牛X的人，你可以了解下，人家私底下一定是花大量的时间自学的，你可能会说，我也想学习啊，可是嘞，该学习啥嘞，不怕告诉你，互联网时代，最不缺的就是学习资源，最宝贵的是啥？ 你可能会说是时间，不，不是时间，而是你的注意力，懂了吧！ 那么，你说学习资源多，我咋不知道，那今天我就告诉你一个你必须知道的学习的地方，人称...

【蘑菇街技术部年会】程序员与女神共舞，鼻血再次没止住。（文末内推）

Linux必懂知识大总结（补）

Java校招入职华为，半年后我跑路了

Python全栈 Linux基础之3.Linux常用命令
Linux对文件（包括目录）有很多常用命令，可以加快开发效率：ls是列出当前目录下的文件列表，选项有-a、-l、-h，还可以使用通配符；c功能是跳转目录，可以使用相对路径和绝对路径；mkdir命令创建一个新的目录，有-p选项，rm删除文件或目录，有-f、-r选项；cp用于复制文件，有-i、-r选项，tree命令可以将目录结构显示出来（树状显示），有-d选项，mv用来移动文件/目录，有-i选项；cat查看文件内容，more分屏显示文件内容，grep搜索内容；>、>>将执行结果重定向到一个文件；|用于管道输出。
​两年前不知如何编写代码的我，现在是一名人工智能工程师

Python实战：抓肺炎疫情实时数据，画2019-nCoV疫情地图

loonggg读完需要5分钟速读仅需 2 分钟大家好，我是你们的校长。我知道大家在家里都憋坏了，大家可能相对于封闭在家里“坐月子”，更希望能够早日上班。今天我带着大家换个思路来聊一个问题...

&lt;!DOCTYPE html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="UTF-8"&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt; &lt;meta http-equiv="X...
Spring框架|JdbcTemplate介绍

B 站上有哪些很好的学习资源?

24岁的程序员，还在未来迷茫，不知道能不能买得起房子