#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define SZ(x) ((int)x.size())
#define L(i,u) for (register int i=head[u]; i; i=nxt[i])
#define rep(i,a,b) for (register int i=(a); i<=(b); i++)
#define per(i,a,b) for (register int i=(a); i>=(b); i--)
using namespace std;
typedef long long ll;
typedef unsigned int ui;
typedef pair<int,int> Pii;
typedef vector<int> Vi;
inline void read(ll &x) {
	x=0; char c=getchar(); int f=1;
	while (!isdigit(c)) {if (c=='-') f=-1; c=getchar();}
	while (isdigit(c)) {x=x*10+c-'0'; c=getchar();} x*=f;
}
inline ui R() {
	static ui seed=416;
	return seed^=seed>>5,seed^=seed<<17,seed^=seed>>13;
}
const int mo = 998244353;
ll n,a[555555],b[55];
ll gcd(ll a,ll b){return !b?a:gcd(b,a%b);}
int main() {
	read(n);rep(i,1,n)read(a[i]);sort(a+1,a+n+1);
	ll tot=1;rep(i,1,n)tot=tot*gcd(a[i],i-1)%mo;cout<<tot;
	return 0;
	n=5;srand(time(0));
	while(1){
	a[0]=1;rep(i,1,n)a[i]=rand()%3+a[i-1];
	memset(b,0,sizeof(b));b[0]=1;
	rep(i,1,n){per(j,i,1)b[j]=(1LL*b[j-1]*a[i]+1LL*b[j]*(i-1));b[0]=0;}
	rep(i,1,n)printf("%d:%lld %lld\n",i,a[i],b[i]);
	ll res=0;rep(i,1,n)res=gcd(res,b[i]);printf("%lld\n",res);
	ll tot=1;rep(i,1,n)tot*=gcd(a[i],i-1);assert(res==tot);
	}
	return 0;
}

### Prompt

In CPP, your task is to solve the following problem:

Niwango-kun has \\(N\\) chickens as his pets. The chickens are identified by numbers \\(1\\) to \\(N\\), and the size of the \\(i\\)-th chicken is a positive integer \\(a_i\\).

\\(N\\) chickens decided to take each other's hand (wing) and form some cycles. The way to make cycles is represented by a permutation \\(p\\) of \\(1, \ldots , N\\). Chicken \\(i\\) takes chicken \\(p_i\\)'s left hand by its right hand. Chickens may take their own hand.

Let us define the cycle containing chicken \\(i\\) as the set consisting of chickens \\(p_i, p_{p_i}, \ldots, p_{\ddots_i} = i\\). It can be proven that after each chicken takes some chicken's hand, the \\(N\\) chickens can be decomposed into cycles.

The beauty \\(f(p)\\) of a way of forming cycles is defined as the product of the size of the smallest chicken in each cycle. Let \\(b_i \ (1 \leq i \leq N)\\) be the sum of \\(f(p)\\) among all possible permutations \\(p\\) for which \\(i\\) cycles are formed in the procedure above.

Find the greatest common divisor of \\(b_1, b_2, \ldots, b_N\\) and print it \\({\rm mod} \ 998244353\\).

Constraints

* \\(1 \leq N \leq 10^5\\)
* \\(1 \leq a_i \leq 10^9\\)
* All numbers given in input are integers

Input

Input is given from Standard Input in the following format:


\(N\)
\(a_1\) \(a_2\) \(\ldots\) \(a_N\)


Output

Print the answer.

Examples

Input

2
4 3


Output

3


Input

4
2 5 2 5


Output

2

### Response

```cpp
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define SZ(x) ((int)x.size())
#define L(i,u) for (register int i=head[u]; i; i=nxt[i])
#define rep(i,a,b) for (register int i=(a); i<=(b); i++)
#define per(i,a,b) for (register int i=(a); i>=(b); i--)
using namespace std;
typedef long long ll;
typedef unsigned int ui;
typedef pair<int,int> Pii;
typedef vector<int> Vi;
inline void read(ll &x) {
	x=0; char c=getchar(); int f=1;
	while (!isdigit(c)) {if (c=='-') f=-1; c=getchar();}
	while (isdigit(c)) {x=x*10+c-'0'; c=getchar();} x*=f;
}
inline ui R() {
	static ui seed=416;
	return seed^=seed>>5,seed^=seed<<17,seed^=seed>>13;
}
const int mo = 998244353;
ll n,a[555555],b[55];
ll gcd(ll a,ll b){return !b?a:gcd(b,a%b);}
int main() {
	read(n);rep(i,1,n)read(a[i]);sort(a+1,a+n+1);
	ll tot=1;rep(i,1,n)tot=tot*gcd(a[i],i-1)%mo;cout<<tot;
	return 0;
	n=5;srand(time(0));
	while(1){
	a[0]=1;rep(i,1,n)a[i]=rand()%3+a[i-1];
	memset(b,0,sizeof(b));b[0]=1;
	rep(i,1,n){per(j,i,1)b[j]=(1LL*b[j-1]*a[i]+1LL*b[j]*(i-1));b[0]=0;}
	rep(i,1,n)printf("%d:%lld %lld\n",i,a[i],b[i]);
	ll res=0;rep(i,1,n)res=gcd(res,b[i]);printf("%lld\n",res);
	ll tot=1;rep(i,1,n)tot*=gcd(a[i],i-1);assert(res==tot);
	}
	return 0;
}

```