Let us consider a square city of size k×k. There is exactly one house in each cell.
People can go from any cell to neighbouring cell (only by side) in 1 unit of time.
Government decided to build n fast bridges to make the city better. Each fast bridge connects two cells (x_1,y_1) and (x_2,y_2) such that x_1=x_2 and y_1=y_2. People can go from one end of the bridge to another in ∣x_1−x_2∣+∣y_1−y_2∣−1 units of time.
To analyze how the city became faster, you are asked to calculate the sum of shortest distances between all pairs of cells. Since it can be large, find it modulo 998,244,353.
The first line contains two integers n, k (0≤n≤500, 2≤k≤109) --- the number of bridges and the size of the city.
Each of the next n lines contains four integers x_1, y_1, x_2, y_2 (1≤x_1<x_2≤k, 1≤y_1,y_2≤k, y_1=y_2). It is guaranteed that all tuples (x_1,y_1,x_2,y_2) are different.
Print a single integer --- the answer to the problem.
In the first example, the shortest distance between all pairs of cells is 1, so the sum is 6.