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.
import os,sys,math
from collections import defaultdict
from io import BytesIO,IOBase
BUFSIZ=8192
class FastIO(IOBase):
    newlines=0
    def __init__(self,file):
        self._fd=file.fileno()
        self.buffer=BytesIO()
        self.writable="n"in file.mode or "r" not in file.mode
        self.write=self.buffer.write if self.writable else None
    def read(self):
        while True: 
            b=os.read(self._fd,max(os.fstat(self._fd).st_size,BUFSIZ))
            if not b:
                break
            ptr=self.buffer.tell()
            self.buffer.seek(0,2),self.buffer.write(b),self.buffer.seek(ptr)
        self.newlines=0
        return self.buffer.read()
    def readline(self):
        while self.newlines==0:
            b=os.read(self._fd,max(os.fstat(self._fd).st_size, BUFSIZ))
            self.newlines=b.count(b"\n")+(not b)
            ptr=self.buffer.tell()
            self.buffer.seek(0, 2),self.buffer.write(b),self.buffer.seek(ptr)
        self.newlines-=1
        return self.buffer.readline()
    def flush(self):
        if self.writable:
            os.write(self._fd,self.buffer.getvalue())
            self.buffer.truncate(0),self.buffer.seek(0)
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer=FastIO(file)
        self.flush=self.buffer.flush
        self.writable=self.buffer.writable
        self.write=lambda s:self.buffer.write(s.encode("ascii"))
        self.rexad=lambda:self.buffer.read().decode("ascii")
        self.readline=lambda:self.buffer.readline().decode("ascii")
if sys.version_info[0]<3:
    sys.stdin,sys.stdout=FastIO(sys.stdin),FastIO(sys.stdout)
else:
    sys.stdin,sys.stdout=IOWrapper(sys.stdin),IOWrapper(sys.stdout)
input=lambda:sys.stdin.readline().rstrip("\r\n")
def divisors(n):
    d=dict()
    num=n
    c=0
    while num%2==0:
        c+=1
        num=num//2
    d[2]=c
    for i in range(3,int(math.sqrt(n))+1,2):
        c=0
        while num%i==0:
            c+=1
            num=num//i 
        d[i]=c
    if num>2:
        d[num]=1
    return d
def I():
    return map(int,input().split())
def haan():
    print("YES")
def nahi():
    print("NO")
def func(l,q,k):
    low=0
    high=k-1
    y=0
    while low<=high:
        mid=(low+high)//2
        if l[mid]>q:
            high=mid-1
        elif l[mid]==q:
            return mid
        else:
            y=mid
            low=mid+1
    return y

def binary(num):
    temp=[0]*20
    n=num
    c=0 
    while c<20:
        temp[c]=n%2
        n=n//2 
        c=c+1
    return temp

d={2:[2],3:[3],4:[3,2,2],5:[5],6:[3,5],7:[7],8:[2,2,2,7],9:[9]}
    
n=int(input())
num=input()
j=[]
ans=[]
for i in num:
    if i!='1' and i!='0':
        j.append(i)
for i in j:
    for k in d[int(i)]:
        ans.append(str(k))
ans.sort(reverse=True)
print("".join(ans))

        
