P7101 [W1] Push

Background

A “point set” is a **multiset** of integer-coordinate points on a 2D plane. A triangle can be formed from a point set if and only if all its vertices are in the point set. From a point set $S$, exactly $|S|^3$ triangles can be formed. (Some triangles may degenerate into a line segment with area $0$.)

Description

There is a point set, initially empty. There are $N$ operations. In each operation, a point is inserted into or deleted from the point set. After each step, you are asked for the sum of the *__eighth powers__* of the areas of all triangles that can be formed from the current point set. Each answer can be written as $a/b$, where $a$ and $b$ are coprime. Output $a\cdot b^{-1}\pmod{998244353}$.

Input Format

The first line contains a positive integer $N$, the number of steps. The next $N$ lines each contain three positive integers $t,x,y$. If $t=1$, insert the point $(x,y)$; if $t=2$, delete the point $(x,y)$.

Output Format

Output $N$ lines. On the $i$-th line, output a positive integer, the answer after the $i$-th step.

Explanation/Hint

For $10\%$ of the testdata, $N\le 10$. For $30\%$ of the testdata, $N\le 10^3$. For another $10\%$ of the testdata, there are no deletion operations. For $100\%$ of the testdata, $1\le N\le 10^5$ and $0\le x,y