H. The Fo Sho
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Neossie is a new UTPC officer! Today is her first time helping organize a UTPC contest, and it is time to serve Torchy's! She has noticed in the past that some of the most popular tacos appear near the end of the line, while some less popular ones appear closer to the front. She wants to experiment with grouping the tacos in ways that maximize the efficiency of the line.

There are $$$n$$$ types of tacos, numbered $$$1, 2, ..., n$$$, that were ordered by UTPC, and thanks to UTPC's generous sponsor, Jane Street, there are is an infinite quantity of each type of taco, and all tacos of a given type are in a single box. There are also $$$m$$$ students attending the contest. Each student wants two tacos, with types $$$a_i$$$ and $$$b_i$$$. Initially, the boxes of tacos are arranged in a line along a very big table. The arrangement of the boxes can be represented by a permutation of $$$1, 2, ..., n$$$. Neossie can split the table into two by cutting it between any adjacent pair of boxes. She can do this as many times as she wants. We will call a sequence of cuts parallelizable if for any student, both of the tacos that they want are on the same table. Neossie wants to maximize the number of tables while performing a sequence of parallelizable cuts.

It is almost 5:30 and the students are beginning to line up for tacos. Every time a student joins the back of the line, Neossie wonders what the maximum number of tables she can form is, over all initial arrangements of boxes. She also wants to know how many initial arrangements of boxes allow her to form that many tables. Note that it is still not 5:30, so none of the students have left the line by the time any student joins the line. Please help Neossie by finding both of these values every time a student joins the line!

Input

The first line of input will contain two integers $$$n$$$ and $$$m$$$ ($$$2 \leq n \leq 2 \cdot 10^5$$$, $$$1 \leq m \leq 2 \cdot 10^5$$$) — the number of types of tacos and the number of students, respectively.

The $$$i$$$th of the next $$$m$$$ lines of input will contain two integers $$$a_i$$$ and $$$b_i$$$ ($$$1 \leq a_i, b_i \leq n$$$), denoting the two types of tacos wanted by the $$$i$$$th student to join the line.

Output

For each student in the order that they join the line, output a line with two space-separated integers, denoting the maximum number of tables and the number of permutations of the boxes which allow Neossie to form the maximum number of tables, respectively. Since the second number may be huge, output it modulo $$$998244353$$$.

Examples
Input
3 3
1 2
1 3
1 2
Output
2 4
1 6
1 6
Input
4 5
3 4
1 2
3 2
2 3
3 4
Output
3 12
2 8
1 24
1 24
1 24