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.
#junior sheet training
'''n=int(input())
arr=[int(i) for i in input().split()]

pre=[1 for i in range(n)]

for i in range(1,n):
    if arr[i]>=arr[i-1]:
        pre[i]=pre[i-1]+1

suf=[1 for i in range(n)]
for k in range(n-2,-1,-1):
    if arr[k]>=arr[k+1]:
        suf[k]=suf[k+1]+1

res=0
for i in range(n):
    res=max(res,pre[i]+suf[i]-1)
print(res)'''


'''n,a=[int(i) for i in input().split()]
arr=[int(i) for i in input().split()]
a-=1

dist=0
res=0
while True:
    left=a-dist
    right=a+dist
    if left>=0 and right<n:
        res+=(2 if arr[right]&arr[left] else 0)
        res-=1 if arr[right]&arr[left] and right==left else 0
    elif left>=0:
        res+=arr[left]
    elif right<n:
        res+=arr[right]
    else:
        break
    dist+=1

print(res)'''

'''n,m=[int(i) for i in input().split()]
cand=[]
for i in range(m):
    cand.append([int(i) for i in input().split()])

cand.sort(key=lambda x:x[1],reverse=True)
res=0
for i in range(m):
    temp=min(n,cand[i][0])
    res+=cand[i][1]*temp
    n-=temp
    if temp<=0:
        break
print(res)'''

'''n=int(input())
arr=[int(i) for i in input().split()]

pre=[arr[0] for i in range(n)]

for i in range(1,n):
    pre[i]=arr[i-1]-arr[i]

res=float("inf")
tot=0
for k in range(1,n):
    tot+=pre[k]
    res=min(res,tot)
res=abs(min(res,0))
print(arr[0]+res)'''


n=int(input())
a=input()

dig=[0 for i in range(10)]
use={2:0,3:0,5:0,7:0}
for i in a:
    i=int(i)
    if i in [2,3,5,7]:
        use[i]+=1
    elif i==4:
        use[3]+=1
        use[2]+=2
    elif i==6:
        use[5]+=1
        use[3]+=1
    elif i==8:
        use[7]+=1
        use[2]+=3
    elif i==9:
        use[7]+=1
        use[3]+=2
        use[2]+=1

ans='7'*use[7]+"5"*use[5]+"3"*use[3]+"2"*use[2]

print(ans)


