A. Saki and False Minoshiro
time limit per test
1.5 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output

Saki is cleaning up the data obtained from false minoshiro she has captured. The data consists of all non-negative integer sequences of length equal to $$$N$$$, where each integer is less than $$$M$$$.

For a sequence $$$s$$$ in the data, we write $$$s=[s_0, \cdots, s_{N-1}]$$$ where $$$s_i$$$ is the $$$i$$$-th integer in $$$s$$$.

Let $$$\pi(s)$$$ be the length of the longest proper prefix that is also a proper suffix. i.e. it is the maximum non-negative integer $$$p$$$ with $$$p \lt N$$$ such that $$$s_i = s_{N-(p-i)}$$$ for all integer $$$0 \le i \lt p$$$. Note that the maximum always exist as $$$p=0$$$ satisfies the condition. When Saki cleans up sequence $$$s$$$, she saves $$$\pi(s)^2$$$ amount of effort.

Saki now wants to know the sum of all efforts she will save when she cleans up the entire data. Write a program to find the sum, modulo $$$998\,244\,353$$$.

Input

The input is given in the following format:

$$$N$$$$$$M$$$

where $$$N$$$ is the length of a sequence, and $$$M$$$ is the upper bound of the size of an element in a sequence plus one.

The input satisfies the following constraints:

  • All numbers in the input are integers.
  • $$$1 \le N \le 100$$$
  • $$$2 \le M \le 1\,000\,000\,000$$$ ($$$= 10^9$$$)
Output

Print a single line containing the sum of all efforts Saki will save when cleaning up the data, modulo $$$998\,244\,353$$$.

Examples
Input
1 2
Output
0
Input
5 3
Output
264