For this Question: While Alicent and Rhaenyra were walking in the Godswood, they noticed a slight abnormality in one of the Weirwood trees. This poked an idea into Alicent's mind, and she decides to ask a puzzle to Rhaenyra.

Alicent selects a tree with N nodes numbered from 1 to N, and gives Rhaenyra an empty array A. Initially, all the nodes in the tree are coloured white. Now, Alicent selects two nodes A and B (A may be equal to B) and colours these two nodes grey. Now, Rhaenyra has to do the following operation N times:

1. Select a grey-coloured node X and colour it black. Then, select all the presently white coloured neighbours of X, and colour them grey. Push X to the end of A.

Once she is done, all the nodes would be coloured black, and array A would be of size N. Now Rhaenyra has to answer how many different arrays A are possible after doing the above sequence of operations. Remember the order of elements in A matter, so [1, 2, 3] != [2, 1, 3].

Since the answer can be very large, simply print it modulo 998244353.The first line contains 3 space-separated integers N, A, and B – the number of nodes in the tree, and the two nodes A and B which Alicent has coloured grey.
Then N-1 lines follow, each line containing two integers X and Y representing an edge between nodes X and Y.

<b>Constraints:</b>
1 ≤ N ≤ 250,000
1 ≤ A, B ≤ N 
1 ≤ X, Y ≤ NPrint a single integer – the number of different possible arrays A modulo 998244353.Sample Input 1:
3 1 3
1 2
2 3

Sample Output 1:
4

Sample Explanation 1:
The possible arrays are [1, 2, 3], [1, 3, 2], [3, 1, 2], [3, 2, 1].

Sample Input 2:
5 1 4
1 2
2 3
3 4
4 5

Sample Output 2:
25, I have written this Solution Code: #include<algorithm>
#include<cstdio>
#include<cctype>
#include<vector>
#define IMP(lim,act) for(int qwq=(lim),i=0;i^qwq;++i)act
const int M=5e5+5,mod=998244353;
int Inv[M],buf[M<<2];int*now=buf,*w[23];
inline void swap(int&a,int&b){
	int c=a;a=b;b=c;
}
inline int Add(const int&a,const int&b){
	return a+b>=mod?a+b-mod:a+b;
}
inline int Del(const int&a,const int&b){
	return b>a?a-b+mod:a-b;
}
inline int max(const int&a,const int&b){
	return a>b?a:b;
}
inline void write(int n){
	static char s[10];int top(0);while(s[++top]=n%10^48,n/=10);while(putchar(s[top--]),top);
}
inline int read(){
	int n(0);char s;while(!isdigit(s=getchar()));while(n=n*10+(s&15),isdigit(s=getchar()));return n;
}
inline int pow(int a,int b=mod-2){
	int ans(1);for(;b;b>>=1,a=1ull*a*a%mod)if(b&1)ans=1ull*ans*a%mod;return ans;
}
inline int Getlen(const int&n){
	int len(0);while((1<<len)<n)++len;return len;
}
inline void init(const int&n){
	const int&m=Getlen(n);w[m]=now;now+=1<<m;Inv[1]=1;
	for(int i=2;i<n;++i)Inv[i]=1ull*(mod-mod/i)*Inv[mod%i]%mod;
	w[m][0]=1;w[m][1]=pow(3,mod-1>>m+1);for(int i=2;i<(1<<m);++i)w[m][i]=1ull*w[m][i-1]*w[m][1]%mod;
	for(int k=m-1;k>=0&&(w[k]=now,now+=1<<k);--k)IMP(1<<k,w[k][i]=w[k+1][i<<1]);
}
struct Poly{
	std::vector<int>F;
	Poly(const Poly&G){F=G.F;}
	Poly(const std::vector<int>G){F=G;}
	Poly(const int&x=0){if(x)F=std::vector<int>(x);}
	inline Poly&resize(const int&len){
		F.resize(len);return*this;
	}
	inline int size()const{
		return F.size();
	}
	inline int&operator[](const int&id){
		return F[id];
	}
	inline void push_back(const int&x){
		F.push_back(x);
	}
	inline Poly&reverse(){
		std::reverse(F.begin(),F.end());return*this;
	}
	inline Poly operator>>(const int&x){
		Poly G;IMP(F.size()-x,G.push_back(F[i+x]));return G;
	}
	inline Poly operator<<(const int&x){
		Poly G;G.resize(x);IMP(F.size(),G.push_back(F[i]));return G;
	}
	inline int operator()(const int&x){
		int y(1),ans(0);IMP(F.size(),ans=(ans+1ull*F[i]*y)%mod),y=1ull*y*x%mod;return ans;
	}
	inline void px(Poly G){
		F.resize(max(F.size(),G.size()));G.resize(F.size());
		for(int i(0);i^F.size();++i)F[i]=1ull*F[i]*G[i]%mod;
	}
	inline Poly&Der(){
		for(int i(1);i^F.size();++i)F[i-1]=1ull*F[i]*i%mod;F.pop_back();return*this;
	}
	inline Poly&Int(){
		F.push_back(0);
		for(int i(F.size()-1);i;--i)F[i]=1ull*F[i-1]*::Inv[i]%mod;F[0]=0;return*this;
	}
	inline void DFT(const int&M){
		int i,k,d,x,y,len,*W,*L,*R;F.resize(1<<M);
		for(len=F.size()>>1,d=M-1;len;--d,len>>=1)for(k=0;k^F.size();k+=len<<1){
			W=w[d];L=&F[k];R=&F[k|len];IMP(len,(x=*L,y=*R)),*L++=Add(x,y),*R++=1ull**W++*Del(x,y)%mod;
		}
	}
	inline void IDFT(const int&M){
		int i,k,d,x,y,len,*W,*L,*R;F.resize(1<<M);
		for(len=1,d=0;len^F.size();len<<=1,++d)for(k=0;k^F.size();k+=len<<1){
			W=w[d];L=&F[k];R=&F[k|len];IMP(len,(x=*L,y=1ull**W++**R%mod)),*L++=Add(x,y),*R++=Del(x,y);
		}
		k=::pow(F.size());IMP(F.size(),F[i]=1ull*F[i]*k%mod);for(i=1;(i<<1)<F.size();++i)swap(F[i],F[F.size()-i]);
	}
	inline Poly operator+(Poly G)const{
		Poly F=this->F;F.resize(max(F.size(),G.size()));G.resize(F.size());
		IMP(F.size(),F[i]=Add(F[i],G[i]));return F;
	}
	inline Poly operator-(Poly G)const{
		Poly F=this->F;F.resize(max(F.size(),G.size()));G.resize(F.size());
		IMP(F.size(),F[i]=Del(F[i],G[i]));return F;
	}
	inline Poly operator*(const int&x)const{
		Poly F=this->F;IMP(F.size(),F[i]=1ull*F[i]*x%mod);return F;
	}
	inline Poly operator*(Poly G)const{
		Poly F=*this;const int&m=F.size()+G.size()-1,&len=Getlen(m);
		F.DFT(len);G.DFT(len);F.px(G);F.IDFT(len);return F.resize(m);
	}
	inline Poly operator/(Poly G){
		Poly F=*this,sav;const int&m=F.size()-G.size()+1;
		sav.resize(m);IMP(m,sav[i]=G.size()+i<m?0:G[G.size()-m+i]);
		sav.reverse().inv();sav*=F.reverse();
		return sav.resize(m).reverse();
	}
	inline Poly operator%(Poly G){
		return(*this-*this/G*G).resize(G.size()-1);
	}
	inline Poly&inv(){
		Poly b1,b2,b3;const int&m=Getlen(F.size());if(!F.empty())b1.push_back(::pow(F[0]));
		for(int len=1;len<=m;++len){
			b3=b1*2;(b2=F).resize(1<<len);
			b1.DFT(len+1);b1.px(b1);b2.DFT(len+1);b1.px(b2);b1.IDFT(len+1);
			b1=b3-b1.resize(1<<len);
		}
		return*this=b1.resize(F.size());
	}
	inline Poly&ln(){
		const int&m=F.size()-1;Poly G=*this;return(this->Der()*=G.inv()).resize(m).Int();
	}
	inline Poly&exp(){
		Poly b1,b2,b3;const int&m=Getlen(F.size());b1.push_back(1);
		for(int len=1;len<=m;++len){
			b3=b2=b1;b2.resize(1<<len).ln();b2=(*this-b2).resize(1<<len);++b2[0];
			b2.DFT(len);b3.DFT(len);b2.px(b3);b2.IDFT(len);b1.resize(1<<len);
			IMP(1<<len-1,b1[1<<len-1|i]=b2[1<<len-1|i]);
		}
		return*this=b1.resize(F.size());
	}
	inline Poly&sqrt(){
		Poly b1,b2;const int&m=Getlen(F.size());b1.push_back(1);
		for(int len=1;len<=m;++len){
			b2=(b1*2).resize(1<<len).inv();
			b1.DFT(len);b1.px(b1);b1.IDFT(len);
			b1=((*this+b1).resize(1<<len)*b2).resize(1<<len);
		}
		return*this=b1.resize(F.size());
	}
	inline Poly&pow(const int&k){
		ln();IMP(F.size(),F[i]=1ull*F[i]*k%mod);return exp();
	}
	inline Poly&operator>>=(const int&x){
		return*this=operator>>(x);
	}
	inline Poly&operator<<=(const int&x){
		return*this=operator<<(x);
	}
	inline Poly&operator+=(const Poly&G){
		return*this=*this+G;
	}
	inline Poly&operator-=(const Poly&G){
		return*this=*this-G;
	}
	inline Poly&operator*=(const Poly&G){
		return*this=*this*G;
	}
	inline Poly&operator/=(const Poly&G){
		return*this=*this/G;
	}
	inline Poly&operator%=(const Poly&G){
		return*this=*this%G;
	}
};
inline Poly resize(Poly F,const int&n){
	return F.resize(n);
}
inline Poly reverse(Poly F){
	return F.reverse();
}
inline Poly Int(Poly F){
	return F.Int();
}
inline Poly Der(Poly F){
	return F.Der();
}
inline Poly px(Poly F,Poly G){
	return F.px(G),F;
}
inline Poly inv(Poly F){
	return F.inv();
}
inline Poly ln(Poly F){
	return F.ln();
}
inline Poly exp(Poly F){
	return F.exp();
}
inline Poly sqrt(Poly F){
	return F.sqrt();
}
inline Poly pow(Poly F,const int&k){
	return F.pow(k);
}
int n,a,b,ege,f[M],h[M],S[M],sz[M],siz[M];bool vis[M];int len,nd[M];
Poly F[M<<2],G[M<<2];
struct Edge{
	int v,nx;
}e[M<<1];
inline void AddEdge(const int&u,const int&v){
	e[++ege]=(Edge){v,h[u]};h[u]=ege;
	e[++ege]=(Edge){u,h[v]};h[v]=ege;
}
inline bool Find(const int&u,const int&fa){
	if(u==a)return vis[nd[++len]=u]=true;
	for(int v,E=h[u];E;E=e[E].nx)if((v=e[E].v)^fa&&Find(v,u))return vis[nd[++len]=u]=true;
	return false;
}
inline void DFS(const int&u,const int&fa){
	siz[u]=1;for(int v,E=h[u];E;E=e[E].nx)if(v=e[E].v,v^fa&&!vis[v])DFS(v,u),siz[u]+=siz[v];
}
inline Poly times(Poly F,Poly G,int k=-1){
	const int&n(F.size()),&m(G.size());if(!n||!m)return Poly();if(!~k)k=n-m+1;
	if(n<64||m<64){
		Poly ans;int i,j;ans.resize(k);
		for(int i=0;i<k;++i)for(int j=0;j<m&&i+j<n;++j)ans[i]=(ans[i]+1ll*F[i+j]*G[j])%mod;
		return ans;
	}
	return(F*G.reverse()>>m-1).resize(k);
}
inline void Build(const int&u,const int&L,const int&R){
	if(L==R)return F[u].push_back(1),F[u].push_back(mod-S[L]);
	const int&mid=L+R>>1;Build(u<<1,L,mid);Build(u<<1|1,mid+1,R);F[u]=F[u<<1]*F[u<<1|1];
}
inline void Solve(const int&u,const int&L,const int&R){
	if(L==R)return void(f[L]=G[u][0]);
	const int&mid=L+R>>1;G[u<<1]=times(G[u],F[u<<1|1]);G[u<<1|1]=times(G[u],F[u<<1]);
	Solve(u<<1,L,mid);Solve(u<<1|1,mid+1,R);
}
inline int Get(const int&u,const int&fa){
	int prod(1);sz[u]=1;for(int v,E=h[u];E;E=e[E].nx)if((v=e[E].v)^fa)prod=1ll*prod*Get(v,u)%mod,sz[u]+=sz[v];
	return 1ll*prod*sz[u]%mod;
}
signed main(){
	int sum(0),prod(1);n=read();a=read();b=read();init(n*2+1);
	for(int u,v,i=1;i<n;++i)u=read(),v=read(),AddEdge(u,v);Find(b,0);
	for(int i=1;i<=len;++i)DFS(nd[i],0);for(int i=1;i<=n;++i)if(!vis[i])prod=1ll*prod*siz[i]%mod;prod=pow(prod);
	if(len==1){
		for(int i=1;i<n;++i)prod=1ll*prod*i%mod;write(prod);
		return 0;
	}
	for(int i=1;i<=len;++i)S[i]=S[i-1]+siz[nd[i]];Build(1,1,len);
	G[1]=times(Der(reverse(F[1])),inv(resize(F[1],len)),len);Solve(1,1,len);
	for(int i=1;i<len;++i)sum=(sum+pow(1ll*(len-i&1?mod-f[i]:f[i])*S[i]%mod))%mod;prod=1ll*prod*sum%mod;
	prod=(prod+pow(Get(a,0)))%mod;prod=(prod+pow(Get(b,0)))%mod;prod=1ll*prod*pow(2)%mod;
	for(int i=1;i<=n;++i)prod=1ll*prod*i%mod;write(prod);
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?