J. Judge Fail
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

During a programming contest, the contestants face an unexpected problem: the judging system (judge) has failed and can no longer evaluate the submissions correctly. However, the contest website had prepared for this eventuality by implementing an alternative judge. This alternative judge, for each submission, randomly selects one of the possible verdicts with equal probability.

However, each contestant has restrictions regarding the verdicts they can receive. For example, competitor Gabmei can never receive the "Wrong Answer" (WA) verdict. Thus, for each submission, the system randomly selects, with equal probability, among the verdicts allowed for that particular contestant.

Given that there are M contestants in the competition—each with their own list of possible verdicts (from among the K available verdicts)—and that N submissions have been made (knowing which contestant made each submission), determine the expected frequency of each verdict at the end of the contest.

Input

The first line of the input contains three integers:

  • N — the number of submissions made $$$(1 \leq N \leq 100000)$$$;
  • M — the number of contestants competing $$$(1 \leq M \leq N)$$$;
  • K — the total number of possible verdicts $$$(1 \leq K \leq 10)$$$.

Then, 2 * M lines are provided regarding the contestants.

For each of the M competitors:

  • The first line contains the number of verdicts they can receive $$$(1 \leq qt \leq K)$$$;
  • The second line lists, in order, the allowed verdicts for that competitor, represented by distinct numbers x $$$(1 \leq x \leq K)$$$.

Finally, N lines follow, each containing the index of the contestant who made the i-th submission $$$(1 \leq i \leq N)$$$.

Output

Output a vector of size K, where the i-th element epresents the expected frequency of verdict i ao final da competição. Cat the end of the contest. Each value must be displayed with at least 6 decimal places.

Examples
Input
4 1 4
4
1 2 3 4
1
1
1
1
Output
1.000000 1.000000 1.000000 1.000000 
Input
2 2 5
3
1 2 3
3
1 2 3
1
2
Output
0.666667 0.666667 0.666667 0.000000 0.000000