#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     while (cin >> n) {       string s;       cin >> s;       string res =   ;       for (int i = 0; i < n; i++) {         if (s[i] <=  1 )           continue;         else {           if (s[i] ==  4 )             res +=  3 , res +=  2 , res +=  2 ;           else {             if (s[i] ==  6 )               res +=  5 , res +=  3 ;             else {               if (s[i] ==  8 )                 res +=  7 , res +=  2 , res +=  2 , res +=  2 ;               else {                 if (s[i] ==  9 )                   res +=  3 , res +=  3 , res +=  2 , res +=  7 ;                 else                   res += s[i];               }             }           }         }       }       sort(res.begin(), res.end());       reverse(res.begin(), res.end());       cout << res << endl;     }   }   