One day Kich decided to make a present to Poch for the new year. Kich has prepared n bags of gifts, each bag contains ki gifts of various kinds. Poch has a list in his head of his favorite kinds of gifts. Initially, it is empty. There are q requests of two kinds:
Poch likes a gift of type x.
Poch disliked gift x.
After each change of the list, Kich is equally likely to choose one of the bags, and after each change of the list, Kich is equally likely to take out one gift from all the gifts in the bag. Then Kich puts the gift back into the bag. Find the probability that Kich takes out one of Poch's favorite items.
The first line contains two non-negative integers n and q (1≤n,q≤105) — the number of bags and the number of requests.
The next n lines contain a non-negative integer ki (0≤ki≤105) — the number of gifts in the bag, and ki non-negative integers — numbered types of gifts.
The next q lines describe the queries:
For a query of the first type: the number 1 and the number x (1≤x≤109) — the kind of gift that Poch liked.
For the second type of query: the number 2 and the number x (1≤x≤109) — the type of gift that Poch disliked.
It is guaranteed that Pochu will not dislike a gift he disliked before the request, nor will he start liking a gift he already liked.
The sum over ki does not exceed 2⋅105.
Print q lines: in line i print the chance that Poch gets one of his favorite gifts, taken modulo 998244353. Since the answer can always be represented as an irreducible fraction ba, where b mod 998244353=0, we ask you to output a⋅b−1 mod 998244353.