RXD has a sequence A1,A2,A3,…An, which possesses the following properties:
- 1≤Ai≤m
- A1=An=1
- for all 1≤x≤m, there is at least one position p where Ap=x.
- for all x,y, the number of i(1≤i<n) which satisfies Ai=x and Ai+1=y is Dx,y.
One day, naughty boy DXR clear the sequence.
RXD wants to know, how many valid sequences are there.
Output the answer module 998244353.
0≤Di,j<500,1≤m≤400
n≥2