Minas is working on his new language. He want to add a feature call expandable listview. Here he explains how it works.
You can see that after clicking on parent_1, id of parent_2 and parent_3 is changed.
Now Minas will give you the number of parent node and their corresponding number of child node. There will be some query each query Minas will give you ID of the clicked node. You need to tell it is parent node or child node and do the clicked operation.
Input starts with an integer () denoting the number of test cases. Each case starts with a line containing an integer () denoting number of parent node. Each of the next lines containing integers (, ) denoting number of child node for -th parent. Next Line contain an integer () denoting number of queries. Next line contain one integer () denoting ID of clicked node.
For each case, print the case number and for each query print “Parent” if clicked node is parent otherwise print “Child”.
Input | Output |
---|---|
1 3 2 2 2 5 1 2 4 1 2 | Case 1: Parent Child Parent Parent Parent |