#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
#define EPS 1e-9
#define F first
#define S second

#define debug(x) cout<<x<<endl;
#define repi(i,x,n) for(int i=x;i<n;i++)
#define rep(i,n) repi(i,0,n)
#define lp(i,n) repi(i,0,n)
#define repn(i,n) for(int i=n;i>=0;i--)
#define int long long
#define endl "\n"
#define N 55

typedef pair<int,int> PII;
typedef pair<int,string> PIS;
typedef pair<string,int> PSI;

int prime[N];
vector<int> p;
int n;
int INF=1;

void eratosthenes(){
  rep(i,N) prime[i]=1;
  prime[0]=prime[1]=0;
  rep(i,N){
    if(prime[i]){
      for(int j=i+i;j<N;j+=i) prime[j]=0;
    }
  }
}

int solve(vector<int> x,int a,int num){
  //cout<<a<<endl;
  int ret=INF;
  if(a==p.size() ){
    
    rep(i,n){
      
      if(x[i]!=0) return ret;
    }
    return num;
  }
  ret=min(solve(x,a+1,num),ret);
  rep(i,n){
    if(x[i]%p[a]==0){
      x[i]=0;
    }
  }
  ret=min(solve(x,a+1,num*p[a]),ret);
  return ret;
  


}

signed main(){
  // cin.tie(0);	
  //ios::sync_with_stdio(false);
 
  cin>>n;
  eratosthenes();
  rep(i,51){
    if(prime[i]==1) {INF*=i;p.push_back(i);}
  }
  vector<int> x(n);
  rep(i,n){
    cin>>x[i];
    //cout<<x[i]<<endl;
  }
  cout<<solve(x,0,1)<<endl;
  
  return 0;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define pb push_back
#define mp make_pair
#define fast ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
#define ff first
#define ss second
#define INF (ll) (1e9)
#define mod (ll) (1e9 + 7)
#define endl "\n"
#define tt ll testcase; cin>>testcase; while(testcase--)
 
const int mxn = 1*(1e5) + 5;
ll n, m;
 
void solve(){
	char s, t;
	cin >> s >> t;
	if(s == 'Y') {
		if(t == 'A' || t == 'B' || t == 'C') {
			cout<<t;
		}
		else if(t == 'a') {
			cout << 'A';
		}else if(t == 'b') {
			cout << 'B';
		}else if(t == 'c') {
			cout << 'C';
		}
	} else {
		cout<<t;
	}
}
 
int main(){
    fast;
    #ifndef ONLINE_JUDGE 
    freopen("input.txt", "r", stdin); 
    freopen("output.txt", "w", stdout); 
    #endif 
     // tt
        solve();
    return 0;
}