Bytelandia States Union

아직 제출이 없습니다시간 제한2초메모리 제한512 MB

문제

There are so many natural wonders in the Bytelandia States Union (BSU)! But the most mysterious wonder is, undoubtedly, the Murbeda Rectangle. Here time and space behave in a rather unusual way. Bytelandian scientists still haven't found a reason why such anomalies occur, even after many years of research. Luckily, they managed to understand how physics works at the Murbeda Rectangle.

Consider the Murbeda Rectangle as a large rectangle. The scientists have divided the rectangle into a grid of 2109×21092 \cdot 10^9 \times 2 \cdot 10^9 small squares. Each square has coordinates (x,y)(x, y), where the xx-axis goes from north to south, and the yy-axis goes from west to east. So, the northwestern square is at (1,1)(1, 1), and the southeastern square is at (2109,2109)(2 \cdot 10^9, 2 \cdot 10^9). There is a portal in the square (x_2,y_2)(x\_2, y\_2) which is the only way to connect the Murbeda Rectangle to the outer world.

Suppose you are in the square (x,y)(x, y) of the rectangle. You can move in one of four directions (north, south, east, or west), thus increasing or decreasing one of the coordinates by one. You cannot go out of the rectangle: for instance, you cannot go south from the square (2109,42)(2\cdot 10^9, 42) or go west from the square (42,1)(42, 1). If you do, you may fall into a deep canyon filled with poisonous snakes.

The most fascinating thing is the amount of time you spend on moving in some direction. If you are in the square (x,y)(x, y), then:

  • going south (increasing the xx-coordinate by one) takes f_s(x,y)=2xy2+2y2+x2f\_s(x, y) = 2xy^2 + 2y^2 + x^2 seconds;
  • going north (decreasing the xx-coordinate by one) takes f_n(x,y)=2xy2+2y2+x2f\_n(x, y) = -2xy^2 + 2y^2 + x^2 seconds;
  • going east (increasing the yy-coordinate by one) takes f_e(x,y)=2x2y+2x2+y2f\_e(x, y) = 2x^2y + 2x^2 + y^2 seconds;
  • going west (decreasing the yy-coordinate by one) takes f_w(x,y)=2x2y+2x2+y2f\_w(x, y) = -2x^2y + 2x^2 + y^2 seconds.

The amount of time spent on moving between squares may even be negative! The place is  really special.

The scientists intend to rescue nn people from the Murbeda Rectangle. For a person who stands in the square (x_1,y_1)(x\_1, y\_1), they need to determine the minimum time needed to reach the portal. One can prove that such a minimal amount of time exists, so no one can reach an infinitely small moment by walking around.

Since the place is extremely unusual, each of the nn persons may require a different portal.

입력

The first line contains an integer nn, the number of people to rescue (1n51041 \le n \le 5 \cdot 10^4).

Each of the following nn lines contains four integers x_1x\_1, y_1y\_1, x_2x\_2, y_2y\_2, denoting the location of the ii-th person and the location of their rescue portal (1x_1,y_1,x_2,y_21091 \le x\_1, y\_1, x\_2, y\_2 \le 10^9).

출력

Print nn lines. The ii-th line should contain the minimal amount of time in seconds for the ii-th person to reach their rescue portal. Since this amount can be pretty large, print it modulo 998,244,353998\\,244\\,353.