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;

#define int            long long int
#define F              first
#define S              second
#define pb             push_back
#define si             set <int>
#define vi             vector <int>
#define pii            pair <int, int>
#define vpi            vector <pii>
#define vpp            vector <pair<int, pii>>
#define mii            map <int, int>
#define mpi            map <pii, int>
#define spi            set <pii>
#define endl           "\n"
#define sz(x)          ((int) x.size())
#define all(p)         p.begin(), p.end()
#define double         long double
#define que_max        priority_queue <int>
#define que_min        priority_queue <int, vi, greater<int>>
#define bug(...)       __f (#__VA_ARGS__, __VA_ARGS__)
#define print(a)       for(auto x : a) cout << x << " "; cout << endl
#define print1(a)      for(auto x : a) cout << x.F << " " << x.S << endl
#define print2(a,x,y)  for(int i = x; i < y; i++) cout<< a[i]<< " "; cout << endl
#define ln             cout << endl;
#define FOR(i,x,y) for(int i=x;i<=y;++i)
#define no cout << "NO" << endl;
#define yes cout << "YES" << endl;
#define pr(VAL) cout << VAL << endl;
int range_from  = 1;
int range_to    = 100;
std::random_device                  rand_dev;
std::mt19937                        generator(rand_dev());
std::uniform_int_distribution<int>  distr(range_from, range_to);

int range_from2  = 'a';
int range_to2    = 'z';
std::random_device                  rand_dev2;
std::mt19937                        generator2(rand_dev2());
std::uniform_int_distribution<int>  distr2(range_from2, range_to2);
int  mod = LONG_LONG_MAX;
inline int gcd(int a, int b)
{
    return b == 0 ? a : gcd(b, a % b);
}

inline long long power(int a, int b)
{
    int x = 1;
    while (b)
    {
        if (b & 1) x = ((x % mod) * (a % mod)) % mod;
        a = ((a % mod ) * ( a % mod) ) % mod;
        b >>= 1;
    }
    return x % mod;
}

template <typename Arg1>
void __f (const char* name, Arg1&& arg1) { cout << name << " : " << arg1 << endl; }
template <typename Arg1, typename... Args>
void __f (const char* names, Arg1&& arg1, Args&&... args)
{
    const char* comma = strchr (names + 1, ',');
    cout.write (names, comma - names) << " : " << arg1 << " | "; __f (comma + 1, args...);
}

inline void solve() {
/////////////////////////////////////////////////////////////////////////////
    int n; cin >>n;
   string str; cin >> str;
   string ans;
    for (int i = 0; i < str.size(); ++i) {
        if(str[i]=='0' or str[i] =='1'){
            continue;
        }
        else {
            int num = str[i] - '0';
            int logg = log2(num);
            if(power(2,logg) == num and str[i] != '2'){
                ans += to_string(num - 1);
                while (num!=1){
                    ans += "2";
                    num/=2;
                }
            }
            else {
                ans += str[i];
            }
        }
    }
    std::sort(ans.begin(), ans.end(), greater<>());
    cout << ans << endl;
/////////////////////////////////////////////////////////////////////////////
}

int32_t main()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    clock_t z = clock();

    int t = 1;
//    cin >> t;
    while (t--) solve();

    cerr << "Run Time : " << ((double)(clock() - z) / CLOCKS_PER_SEC);

    return 0;
}