Little Dimasik is a rational numbers fan. He has n rational numbers y_ix_i. Recently Dimasik learned how to subtract rational numbers.
Recall that every rational number may be expressed in a unique way as an irreducible fraction ba, where a and b are coprime integers and b>0.
Let us define the function d(y_ix_i) as the denominator of the rational number y_ix_i in irreducible notation. For example, d(614)=d(37)=3.
Now Dimasik wants to calculate the value ∏_1≤i<j≤nd(y_ix_i−y_jx_j ). But soon he realized that this problem is too hard for him. Dimasik asks you to help him. As the value may be very large, find it modulo 998,244,353.
The first line contains one integer n (1≤n≤2⋅105) denoting the number of rational numbers Dimasik has.
Each of the following n lines contains two integers x_i and y_i (0≤x_i≤109, 1≤y_i≤106) representing the numerator and denominator of the i-th rational number.
Print a single integer --- the answer to the problem modulo 998,244,353.