#### Registered Users Only

Please login to view and utilize this feature.

## Problem Description

Rar the Cat has *N* tables of Chinese New Year food items. Table *i* has *M _{i}* food items on it. For convenience, each food is labelled as an integer from 0 to 10

^{9}. Different food items have different labels while identical food items will have the same label.

As there can be more than 1 of the same food item on each tables, Rar the Cat wants to know how many distinct food items there are on each table. Also, Rar the Cat wants to know how many distinct food items there are in all the *N* tables combined.

## Limits

For all testcases, 0 ≤ A_{i} ≤ 10^{9}.

Subtask 1 (39%): N = 1, 0 ≤ M_{1} ≤ 10^{6}.

Subtask 2 (12%): 1 ≤ N ≤ 100000, Sum of M_{i} ≤ 10^{6}. However, if a food appears in one table, it will not appear in all other tables. Still, there can be multiple copies of the same food on that single table.

Subtask 3 (49%): 1 ≤ N ≤ 100000, Sum of M_{i} ≤ 10^{6}.

Subtask 4 (0%): Sample Testcases.

## Input

The first line of input will contain one integer, *N*.

*N* lines will follow. The first integer of the *i ^{th}* line is

*M*. Then,

_{i}*M*integers will be provided in the same line. Each of these integers is between 0 and 10

_{i}^{9}, representing a food item.

## Output

You are to output *N+1* integers, one on each line.

The first *N* integers should be the number of distinct food items there are on each table. The *i ^{th}* of these lines should contain the answer to the

*i*table.

^{th}The last integer should be the number of distinct food items there are on all *N* tables combined.

## Sample Testcase 1

### Input

3 5 1 2 3 2 3 5 4 5 5 4 4 3 6 6 6

### Output

3 2 1 6

## Sample Testcase 2

### Input

3 5 1 2 3 4 5 4 1 2 2 6 7 1 6 2 5 10 2 1

### Output

5 3 5 7

### Explanation

Table 1 has 5 distinct food items: 1, 2, 3, 4, 5.

Table 2 has 3 distinct food items: 1, 2, 6.

Table 3 has 5 distinct food items: 1, 2, 5, 6, 10.

Table 1 to 3 combined have 7 distinct food items: 1, 2, 3, 4, 5, 6, 10.

### Tags

### Subtasks and Limits

Subtask | Score | #TC | Time | Memory | Scoring |
---|---|---|---|---|---|

1 | 39 | 6 | 3s | 256MB | Minimum |

2 | 12 | 12 | 3s | 256MB | Minimum |

3 | 49 | 22 | 3s | 256MB | Minimum |

4 | 0 | 2 | 3s | 256MB | Minimum |

### Judge Compile Command

g++ ans.cpp -o cnyfood -Wall -static -O2 -lm -m64 -s -w -std=gnu++14 -fmax-errors=512