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 bisect
import math
from collections import deque
import heapq
import functools
from collections import defaultdict
 
mod =  998244353 
N = 200005
 
getnums = lambda: map(int, input().split())
getnum = lambda: int(input())
 
def mul(a, b):
	return (a*b)%mod
 
def add(a, b):
	return (a+b) if (a+b<mod) else (a+b)-mod
 
def sub(a, b):
	return (a-b) if (a-b>=0) else (a-b)+mod
 
def powr(a, b):
	ans = 1
	while b>0:
		if b & 1:
			ans=mul(ans,a)
		a = mul(a,a) 
		b//=2
	return ans
 
def inv(n):
	return powr(n, mod-2)
 
def factlist():
	fact = [1]
	for i in range(1, N):
		fact.append(mul(fact[i-1],i))
	return fact
 
def invfactlist(fact):
	invfact=[0]*N
	invfact[0]=1
	invfact[N-1]= inv(fact[N-1])
	for i in range(N-2, 0, -1):
		invfact[i]= mul(invfact[i+1],(i+1))
	
	return invfact
 
def rot(S):
	return list(zip(*S[::-1]))
 
def gcd(a, b):
	if b==0:
		return a
	return gcd(b, a%b)
 
def generate():
	ans = [0]
	while ans[-1]<1000000000:
		ans.append(1+ans[-1]*2)
	return ans
 
 
def __gcd(a, b):
    if (a == 0):
        return b
    return __gcd(b % a, a)
 
 
def LcmOfArray(arr, idx):
 
    if (idx == len(arr)-1):
        return arr[idx]
    a = arr[idx]
    b = LcmOfArray(arr, idx+1)
    return int(a*b/__gcd(a,b)) 
 
 
# con = dict()
 
class Node:
	def __init__(self, val):
		self.val = val
		self.child = None
		self.parent = None
 
 
	def addrear(self, y):
		self.child = y
		y.parent = self
 
 
	def deleterear(self, y):
		self.child = None
		y.parent = None
 
	def findparent(self):
		parent = self.parent
		node = self
		while parent:
			node = parent
			parent = parent.parent
		return node
 
	def getelem(self):
		lst = [self.val]
		ch = self.child
		while ch:
			lst.append(ch.val)
			ch= ch.child
		return lst
 
 
def main():
	n = getnum()
	s = input()
	lst = []
	for i in s:
		num = ord(i)-ord('0')
		if num>1:
			lst.append(num)
	for i in range(len(lst)):
		if lst[i]&1==0:
			if lst[i]==4:
				lst.append(2)
				lst.append(2)
			if lst[i]==6:
				lst.append(3)
			if lst[i]==8:
				lst.append(2)
				lst.append(2)
				lst.append(2)
			if lst[i]>2:
				lst[i] = lst[i]-1
	lst.sort(reverse=True)
	print("".join(map(str, lst)))
	
 
if __name__ == "__main__":
	main()
		
    