Problem: We have a square grid with N rows and M columns. Takahashi will write an integer in each of the squares, as follows:

* First, write 0 in every square.
* For each i=1,2,...,N, choose an integer k_i (0\leq k_i\leq M), and add 1 to each of the leftmost k_i squares in the i-th row.
* For each j=1,2,...,M, choose an integer l_j (0\leq l_j\leq N), and add 1 to each of the topmost l_j squares in the j-th column.



Now we have a grid where each square contains 0, 1, or 2. Find the number of different grids that can be made this way, modulo 998244353. We consider two grids different when there exists a square with different integers.

Constraints

* 1 \leq N,M \leq 5\times 10^5
* N and M are integers.

Input

Input is given from Standard Input in the following format:


N M


Output

Print the number of different grids that can be made, modulo 998244353.

Examples

Input

1 2


Output

8


Input

2 3


Output

234


Input

10 7


Output

995651918


Input

314159 265358


Output

70273732

Solution (in CPP):

Solution:
#pragma GCC optimize(2,3,"Ofast")
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define db double
#define in inline
namespace fast_io
{
	char buf[1<<12],*p1=buf,*p2=buf,sr[1<<23],z[23],nc;int C=-1,Z=0,Bi=0,ny;
	in char gc() {return p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<12,stdin),p1==p2)?EOF:*p1++;}
	in int read()
	{
		int x=0;ny=1;while(nc=gc(),(nc<48||nc>57)&&nc!=EOF)if(nc==45)ny=-1;Bi=1;if(nc<0)return nc;
		x=nc-48;while(nc=gc(),47<nc&&nc<58&&nc!=EOF)x=(x<<3)+(x<<1)+(nc^48),Bi++;return x*ny;
	}
	in db gf() {int a=read(),y=ny,b=(nc!='.')?0:read();return (b?a+(db)b/pow(10,Bi)*y:a);}
	in int gs(char *s) {char c,*t=s;while(c=gc(),c<32);*s++=c;while(c=gc(),c>32)*s++=c;return s-t;}
	in void ot() {fwrite(sr,1,C+1,stdout);C=-1;}
	in void flush() {if(C>1<<22) ot();}
	template <typename T>
	in void write(T x,char t)
	{
		int y=0;if(x<0)y=1,x=-x;while(z[++Z]=x%10+48,x/=10);
		if(y)z[++Z]='-';while(sr[++C]=z[Z],--Z);sr[++C]=t;flush();
	}
	in void write(char *s) {int l=strlen(s);for(int i=0;i<l;i++)sr[++C]=*s++;sr[++C]='\n';flush();}
};
using namespace fast_io;
const int N=5e5+5,p=998244353;
int n,m,mx,mn,ans,cm[N],cn[N],fac[N],inv[N];
in void M(int &x) {x-=p;x+=x>>31&p;}
in int qpow(int a,int b) {int c=1;for(;b;b>>=1,a=1ll*a*a%p)if(b&1)c=1ll*a*c%p;return c;}
in int c(int n,int m) {return 1ll*fac[n]*inv[m]%p*inv[n-m]%p;}
int main()
{
	n=read(),m=read();mx=max(n,m);mn=min(n,m);
	fac[0]=cm[0]=cn[0]=1;for(int i=1;i<=mx;i++) fac[i]=1ll*fac[i-1]*i%p;
	inv[mx]=qpow(fac[mx],p-2);for(int i=mx-1;~i;i--) inv[i]=inv[i+1]*(i+1ll)%p;
	for(int i=1;i<=n;i++) cm[i]=cm[i-1]*(m+1ll)%p;
	for(int i=1;i<=m;i++) cn[i]=cn[i-1]*(n+1ll)%p;
	for(int i=0;i<=mn;i++)
	{
		int res=1ll*c(n,i)*c(m,i)%p*fac[i]%p*cm[n-i]%p*cn[m-i]%p;
		M(ans+=(i&1)?p-res:res);
	}
	write(ans,'\n');
	return ot(),0;
}
//Author: disangan233