#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
using namespace std;
#define MOD 998244353
#define ADD(X,Y) ((X) = ((X) + (Y)%MOD) % MOD)
typedef long long i64; typedef vector<int> ivec; typedef vector<string> svec;

int N;
i64 A[101010];

i64 gcd(i64 a, i64 b)
{
	while (b > 0) {
		i64 tmp = a % b;
		a = b;
		b = tmp;
	}
	return a;
}

i64 solve_fast()
{
	i64 ret = A[0];
	for (int i = 1; i < N; ++i) {
		i64 g = gcd(i, A[i]);
		i64 a = i / g, b = A[i] / g;
		ret = ret * g % MOD;
	}
	return ret;
}

int main()
{
	scanf("%d", &N);
	for (int i = 0; i < N; ++i) scanf("%lld", A + i);
	sort(A, A + N);
	/*

	vector<int> perm;
	for (int i = 0; i < N; ++i) perm.push_back(i);

	i64 B[12];
	for (int i = 1; i <= N; ++i) B[i] = 0;
	do {
		vector<bool> marked(N, false);
		i64 prod = 1;
		int cyc = 0;
		for (int i = 0; i < N; ++i) if (!marked[i]) {
			i64 mn = A[i];
			int p = i;
			while (!marked[p]) {
				marked[p] = true;
				mn = min(mn, A[p]);
				p = perm[p];
			}
			prod *= mn;
			++cyc;
		}
		B[cyc] += prod;
	} while (next_permutation(perm.begin(), perm.end()));

	for (int i = 1; i <= N; ++i) printf("%d: %lld\n", i, B[i]);
	i64 sol = B[1];
	for (int i = 2; i <= N; ++i) sol = gcd(sol, B[i]);
	printf("%lld\n", sol);
	*/
	printf("%lld\n", solve_fast());
	return 0;
}

### Prompt

Generate a cpp solution to 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 <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
using namespace std;
#define MOD 998244353
#define ADD(X,Y) ((X) = ((X) + (Y)%MOD) % MOD)
typedef long long i64; typedef vector<int> ivec; typedef vector<string> svec;

int N;
i64 A[101010];

i64 gcd(i64 a, i64 b)
{
	while (b > 0) {
		i64 tmp = a % b;
		a = b;
		b = tmp;
	}
	return a;
}

i64 solve_fast()
{
	i64 ret = A[0];
	for (int i = 1; i < N; ++i) {
		i64 g = gcd(i, A[i]);
		i64 a = i / g, b = A[i] / g;
		ret = ret * g % MOD;
	}
	return ret;
}

int main()
{
	scanf("%d", &N);
	for (int i = 0; i < N; ++i) scanf("%lld", A + i);
	sort(A, A + N);
	/*

	vector<int> perm;
	for (int i = 0; i < N; ++i) perm.push_back(i);

	i64 B[12];
	for (int i = 1; i <= N; ++i) B[i] = 0;
	do {
		vector<bool> marked(N, false);
		i64 prod = 1;
		int cyc = 0;
		for (int i = 0; i < N; ++i) if (!marked[i]) {
			i64 mn = A[i];
			int p = i;
			while (!marked[p]) {
				marked[p] = true;
				mn = min(mn, A[p]);
				p = perm[p];
			}
			prod *= mn;
			++cyc;
		}
		B[cyc] += prod;
	} while (next_permutation(perm.begin(), perm.end()));

	for (int i = 1; i <= N; ++i) printf("%d: %lld\n", i, B[i]);
	i64 sol = B[1];
	for (int i = 2; i <= N; ++i) sol = gcd(sol, B[i]);
	printf("%lld\n", sol);
	*/
	printf("%lld\n", solve_fast());
	return 0;
}

```