Drazil is playing a math game with Varda.

Let's define <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/7020b94c48be2ee5b8eeca05f379c8911bb0e7c4.png" style="max-width: 100.0%;max-height: 100.0%;"/> for positive integer *x* as a product of factorials of its digits. For example, <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/6784d861d9a724d0aeddefcb00b7d0c3442ae586.png" style="max-width: 100.0%;max-height: 100.0%;"/>.

First, they choose a decimal number *a* consisting of *n* digits that contains at least one digit larger than 1. This number may possibly start with leading zeroes. Then they should find maximum positive number *x* satisfying following two conditions:

1. *x* doesn't contain neither digit 0 nor digit 1.

2. <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/7020b94c48be2ee5b8eeca05f379c8911bb0e7c4.png" style="max-width: 100.0%;max-height: 100.0%;"/> = <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/aa57e017a6c74d06b0a54bc47e3f6990e5af38c1.png" style="max-width: 100.0%;max-height: 100.0%;"/>.

Help friends find such number.
The first line contains an integer *n* (1 ≤ *n* ≤ 15) — the number of digits in *a*.

The second line contains *n* digits of *a*. There is at least one digit in *a* that is larger than 1. Number *a* may possibly contain leading zeroes.
#include <bits/stdc++.h>
using namespace std;
const int MAXINT = 1e7;
int fr[MAXINT];
#define F first
#define S second
using ll = long long;using ld = long double;
using ld = long double;using vi = vector<int>;
#define int long long
using vl = vector<ll>;using vs = vector<string>; using stc = stack <char>  ;
//const string alfa = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ;

#define mp make_pair
#define all(x) begin(x), end(x)
// #define rall(vec) vec.rbegin(), vec.rend()
#define el "\n"
#define CC(x) cout << (x) << endl
#define YES cout<<"YES\n";
#define NO cout<<"NO\n";
#define rep(i,a,b) for (int i = a; i < b; ++i)
#define loop1(n) for(int i=1;i<=n;i++)
#define siz(arr) sizeof(arr)/sizeof(arr[0])
#define sz(x) int(x.size())
//#define pair<ll, ll> pl
void Allah_yostork_t3deha  (){
    ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("put","r",stdin);
    freopen("OUTT", "w", stdout);
#endif

}
#define tc ll tcc ; cin>> tcc ; while (tcc--)

template < typename T = int > istream& operator >> (istream &in, vector < T > &v) {
    for (auto &x : v) in >> x;
    return in;
}
template < typename T = int > ostream& operator << (ostream &out, const vector < T > &v) {
    for (const T &x : v) out << x << ' ';
    return out;
}
long long fp(long long base, long long exp){
    if (exp == 0) return 1;
    long long ans = fp(base, exp / 2);
    ans = (ans * ans) ;
    if (exp % 2 != 0) ans = (ans * (base));
    return ans;
}
#define loop(n) for(int i=0;i<n;i++)
#define an ll n;cin>>n;ll a[n];rep(i,0,n)cin>>a[i];
const double pi = 3.141592653;
bool cmp (pair<double , int > i   , pair<double , int> j){
    if (i.F == j.F) return i.S < j.S;
    else return i.F > j.F ;

}
vector<int> divisors(int n){ // O(sqrt(n))
    vector<int>v;
    for (int i = 1; i * i <= n; i++) {
        if (n % i == 0){
            v.push_back(i);
            if(n / i != i)
                v.push_back(n / i);
        }
    }
    return v;
}
//int n  , a,  g , sa=0  ,sg = 0 ;cin >> n ;
//vector <pair<int , int >> v;
//rep(i,0,n){
//cin >> a >> g ;
//v.push_back({a,g}) ;
//sa+=a , sg+= g;
//} string ans ="" ;
//cout << sa<<  ' ' << sg  << el;
//
//rep(i,0,n){
//if (sa-sg > 500 ) sa-=v[i].F   , ans +='G';
//else  if (sg-sa > 500 )  sg -= v[i].S  , ans +='A';
//else ans += 'A' , sg -= v[i].S;
//cout << sa<<  ' ' << sg  << el;
//}
//if (sa - sg   > 500) rep(i,0,n){
//if ((sa - v[i].F ) - (sg + v[i].S) <= 500 ) { ans[i] = 'G';break; }
//}
//if (sg - sa   > 500) rep(i,0,n){
//if ((sg - v[i].S ) - (sa + v[i].F) <= 500 ) { ans[i] = 'A';break; }
//}
//cout << ans << el;
bool isprime(ll x){
    if(x==2) return 1;
    if(x==1 || x%2==0) return 0;
    for(int i=2;i<=sqrt(x);i++){
        if(x%i==0)
            return false;}
    return true;
}
vector<int> primeFactorization(int n){ // O(sqrt(n))
    vector<int>v;
    for(int i = 2; i * i <= n; i++){
        while (n % i == 0){
            n /= i;
            v.push_back(i);
        }

    }
    if(n > 1)
        v.push_back(n);
    return v;
}
//int dp (int  i , int rm ,vector<int >& coins  ,vector< vector< int>>& mem) {
//    if (rm ==0) return 1 ;
//    if(i==coins.size()) return 0;
//    if (mem[i][rm] != -1 ) return mem[i][rm] ;
//    int op1  = (rm >= coins[i]) ? dp(i , rm-coins[i] , coins , mem) : 0 ;
//    int op2 = dp(i+1 , rm  , coins  , mem)  ;
//    return mem[i][rm] = (op1 + op2) ;
//}

bool isPowerOfTwo(ll x) {
    return x && ((x & (x - 1)) == 0);
}
ll mul(ll A, ll B, ll mod){
    A %= mod;
    B %= mod;
    return (A * B) % mod;
}
//vi a (1000005);
//bool check (int mid) {
//    set <int > st ;
//    rep(i,0,mid) st.insert(a[i]) ;
//    if (st.size() > 2 ) return false ;
//    else if (st.size() == 2) {
//        auto fir = st.begin(); advance(fir, 1);
//        auto sec = st.begin(); advance(sec, 2);
//        int x = *fir , y = *sec ;
//        if (abs(y-x) ==1 ) return true ;
//        else return false  ;
//    }
//    return true ;
//
//}

void Mt2olesh_Wrong_Argooook() {
int n ;cin >> n  ;
string s , ans =""; cin >> s ;
for (int i = 0 ; i < n ; ++ i ) {
    if (s[i] == '4') ans += "223" ;
    else if (s[i] == '6') ans += "53" ;
    else if (s[i] == '8') ans += "7222" ;
    else if (s[i] == '9') ans += "3372" ;
    else if (s[i] == '1' || s[i] =='0')  ;
    else ans +=s[i] ;
}
    sort(all(ans) ) , reverse(all(ans))  ;
cout << ans  ;

}
signed main() {
    Allah_yostork_t3deha();
    //tc
    Mt2olesh_Wrong_Argooook();



}