human
Here strategy she uses given the following:
Alice has got addicted to a game called Sirtet recently.

In Sirtet, player is given an n × m grid. Initially a_{i,j} cubes are stacked up in the cell (i,j). Two cells are called adjacent if they share a side. Player can perform the following operations: 

  * stack up one cube in two adjacent cells.

  * stack up two cubes in one cell. 


Cubes mentioned above are identical in height.

Here is an illustration of the game. States on the right are obtained by performing one of the above operations on the state on the left, and grey cubes are added due to the operation.


Player's goal is to make the height of all cells the same (i.e. so that each cell has the same number of cubes in it) using above operations. 

Alice, however, has found out that on some starting grids she may never reach the goal no matter what strategy she uses. Thus, she is wondering the number of initial grids such that 

  * L ≤ a_{i,j} ≤ R for all 1 ≤ i ≤ n, 1 ≤ j ≤ m.

  * player can reach the goal using above operations. 


Please help Alice with it. Notice that the answer might be large, please output the desired value modulo 998,244,353.

Input

The only line contains four integers n, m, L and R (1≤ n,m,L,R ≤ 10^9, L ≤ R, n ⋅ m ≥ 2).

Output

Output one integer, representing the desired answer modulo 998,244,353.

Examples

Input

2 2 1 1

Output

1

Input

1 2 1 2

Output

2

Note

In the first sample, the only initial grid that satisfies the requirements is a_{1,1}=a_{2,1}=a_{1,2}=a_{2,2}=1. Thus the answer should be 1.

In the second sample, initial grids that satisfy the requirements are a_{1,1}=a_{1,2}=1 and a_{1,1}=a_{1,2}=2. Thus the answer should be 2.
The above is tricky. Write me a correct solution in PYTHON3.
assistant
#Here strategy she uses.

import sys
readline = sys.stdin.readline

MOD = 998244353 
class Modmat:
    def __init__(self, A):
        self.Mat = A
    def __mul__(self, B):
        assert len(self.Mat[0]) == len(B.Mat), 'invalid size'
        L = len(self.Mat)
        M = len(self.Mat[0])
        N = len(B.Mat[0])
        
        res = [[0]*N for _ in range(L)]
        
        for i in range(L):
            for j in range(N):
                a = 0
                for k in range(M):
                    a = (a+self.Mat[i][k]*B.Mat[k][j])%MOD
                res[i][j] = a 
                
        return Modmat(res)
    
    def __pow__(self, x):
        N = len(self.Mat)
        res = [[0]*N for _ in range(N)]
        for i in range(N):
            res[i][i] = 1
        res = Modmat(res)
        A = Modmat(self.Mat)
        for i in range(x.bit_length()):
            if 2**i & x:
                res = res * A
            A = A*A
        return Modmat(res)
    
    def __getitem__(self, i):
        return self.Mat[i]
    
    def __len__(self):
        return len(self.Mat)
N, M, L, R = map(int, readline().split())
R -= L
if N&1 and M&1:
    ans = pow(R+1, N*M, MOD)
else:
    Bl = N*M//2
    even = (R+1)//2
    odd = R+1 - even
    Mat = Modmat([[even, odd], [odd, even]])
    initmat = Modmat([[1], [0]])
    xy = (Mat**Bl*initmat)
    x, y = xy[0][0], xy[1][0]
    ans = (x*x + y*y) % MOD
    
print(ans)