/*
IftekharMd.Shishir
Dept. of Information and Communication Engineering
University of Rajshahi
*/
#include<bits/stdc++.h>
IftekharMd.Shishir
Dept. of Information and Communication Engineering
University of Rajshahi
*/
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define ld long double
#define f(i,n) for(i=0;i<n;i++)
#define F(i,n) for(i=n-1;i>=0;i--)
#define fa(i,a,b) for(i=a;i<=b;i++)
#define Fa(i,a,b) for(i=a;i>=b;i--)
#define printArray(i,a,n) f(i,n)cout<<a[i]<<" "; cout<<endl;
#define printLinkedList() temp=head;while(temp){cout<<temp->data<<" ";temp=temp->post;} cout<<endl;
#define pb(x) push_back(x)
#define pob() pop_back()
#define all(a) a.begin(),a.end()
#define sor(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define mem(a,x) memset(a,x,sizeof(a))
#define maxElement max_element
#define minElement min_element
//[ ll *it; it = maxElement(a,a+n); ]
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define mp make_pair
#define txtIO freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define txtTest freopen("C:/Users/Iftekhar/Documents/what/input.txt", "r", stdin);
#define FastIO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);ios::sync_with_stdio(0);
#define TestCase ll t;cin>>t;while(t--)
#define points(x) fixed<<setprecision(x)
#define gcd(x,y) __gcd(x,y)
#define scd(a,x,y) a/gcd(x,y);
#define nl cout<<endl;
#define done return 0
const double PI= 2*acos(0.0);
const long long MOD= 1000000007;
const long long MAX = 32000;
// stringstream demo(str); demo >> x;
// stringstream demo; demo << x; name=demo.str();
using namespace std;
vector<ll> result;
ll ans(ll x)
{
ll i;
if(x==1 || x==0) return 0;
if(x==4)
{
result.pb(3);
result.pb(2);
result.pb(2);
}
else if(x==6)
{
result.pb(5);
result.pb(3);
}
else if(x==8)
{
result.pb(7);
result.pb(2);
result.pb(2);
result.pb(2);
}
else if(x==9)
{
result.pb(7);
result.pb(3);
result.pb(3);
result.pb(2);
}
else result.pb(x);
}
int main()
{
ll n,i;
string str;
cin>>n>>str;
f(i,n)
{
ll x = str[i]-48;
ans(x);
}
sort(all(result));
reverse(all(result));
f(i,result.size()) cout<<result[i]; nl;
done;
}
Comments
Post a Comment