#include <bits/stdc++.h>
using namespace std;
long long n, m, l, r, t1, t2, t3, ans;
const long long mod = 998244353;
long long fpow(long long b, long long p) {
  if (b == 0) return 0;
  long long ans = 1, t = b;
  while (p) {
    if (p % 2) ans = (ans * t) % mod;
    t = (t * t) % mod;
    p /= 2;
  }
  return ans;
}
int main() {
  scanf("%lld%lld%lld%lld", &n, &m, &l, &r);
  if (n % 2 && m % 2) {
    t1 = (r - l + 1) % mod;
    t3 = (n % (mod - 1)) * (m % (mod - 1)) % (mod - 1);
    ans = fpow(t1, t3);
  } else {
    long long o = (r + 1) / 2 - l / 2, e = r / 2 - (l - 1) / 2;
    t1 = (e + o) % mod;
    t2 = ((e - o) % mod + mod) % mod;
    t3 = (n % (mod - 1)) * (m % (mod - 1)) % (mod - 1);
    ans = fpow(t1, t3) + fpow(t2, t3);
    ans = (ans % mod + mod) % mod;
    ans = ans * fpow(2, mod - 2) % mod;
  }
  printf("%lld", ans);
}

### Prompt

Develop a solution in cpp to the problem described below:

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.

<image>

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.

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
long long n, m, l, r, t1, t2, t3, ans;
const long long mod = 998244353;
long long fpow(long long b, long long p) {
  if (b == 0) return 0;
  long long ans = 1, t = b;
  while (p) {
    if (p % 2) ans = (ans * t) % mod;
    t = (t * t) % mod;
    p /= 2;
  }
  return ans;
}
int main() {
  scanf("%lld%lld%lld%lld", &n, &m, &l, &r);
  if (n % 2 && m % 2) {
    t1 = (r - l + 1) % mod;
    t3 = (n % (mod - 1)) * (m % (mod - 1)) % (mod - 1);
    ans = fpow(t1, t3);
  } else {
    long long o = (r + 1) / 2 - l / 2, e = r / 2 - (l - 1) / 2;
    t1 = (e + o) % mod;
    t2 = ((e - o) % mod + mod) % mod;
    t3 = (n % (mod - 1)) * (m % (mod - 1)) % (mod - 1);
    ans = fpow(t1, t3) + fpow(t2, t3);
    ans = (ans % mod + mod) % mod;
    ans = ans * fpow(2, mod - 2) % mod;
  }
  printf("%lld", ans);
}

```