#include <bits/stdc++.h>
const int maxn = 45;
int n, a[11];
char s[maxn];
std::string dp[141][51][21][21], trans[11];
namespace R {
inline std::string max(std::string a, std::string b) {
  if (a.length() != b.length()) return a.length() > b.length() ? a : b;
  return a > b ? a : b;
}
}  // namespace R
int main() {
  scanf("%d%s", &n, s + 1);
  for (int i = 2; i <= 9; i++) trans[i].push_back(i + 48);
  for (int i = 1; i <= n; i++) {
    for (int j = 2; j <= s[i] - 48; j++) {
      int now = j;
      if (now % 2 == 0) {
        while (now % 2 == 0) a[2]++, now /= 2;
      }
      if (now % 3 == 0) {
        while (now % 3 == 0) a[3]++, now /= 3;
      }
      if (now == 5) a[5]++;
      if (now == 7) a[7]++;
    }
  }
  dp[0][0][0][0] = "";
  for (int i = 0; i <= a[2]; i++) {
    for (int j = 0; j <= a[3]; j++) {
      for (int p = 0; p <= a[5]; p++) {
        for (int q = 0; q <= a[7]; q++) {
          if ((i || j || p || q) && dp[i][j][p][q] == "") continue;
          dp[i + 1][j][p][q] =
              R::max(dp[i + 1][j][p][q], trans[2] + dp[i][j][p][q]);
          dp[i + 1][j + 1][p][q] =
              R::max(dp[i + 1][j + 1][p][q], trans[3] + dp[i][j][p][q]);
          dp[i + 3][j + 1][p][q] =
              R::max(dp[i + 3][j + 1][p][q], trans[4] + dp[i][j][p][q]);
          dp[i + 3][j + 1][p + 1][q] =
              R::max(dp[i + 3][j + 1][p + 1][q], trans[5] + dp[i][j][p][q]);
          dp[i + 4][j + 2][p + 1][q] =
              R::max(dp[i + 4][j + 2][p + 1][q], trans[6] + dp[i][j][p][q]);
          dp[i + 4][j + 2][p + 1][q + 1] =
              R::max(dp[i + 4][j + 2][p + 1][q + 1], trans[7] + dp[i][j][p][q]);
          dp[i + 7][j + 2][p + 1][q + 1] =
              R::max(dp[i + 7][j + 2][p + 1][q + 1], trans[8] + dp[i][j][p][q]);
          dp[i + 7][j + 4][p + 1][q + 1] =
              R::max(dp[i + 7][j + 4][p + 1][q + 1], trans[9] + dp[i][j][p][q]);
        }
      }
    }
  }
  std::cout << dp[a[2]][a[3]][a[5]][a[7]] << std::endl;
  return 0;
}

### Prompt

Please formulate a Cpp solution to the following problem:

Drazil is playing a math game with Varda.

Let's define <image> for positive integer x as a product of factorials of its digits. For example, <image>.

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. <image> = <image>.

Help friends find such number.

Input

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.

Output

Output a maximum possible integer satisfying the conditions above. There should be no zeroes and ones in this number decimal representation.

Examples

Input

4
1234


Output

33222


Input

3
555


Output

555

Note

In the first case, <image>

### Response

```cpp
#include <bits/stdc++.h>
const int maxn = 45;
int n, a[11];
char s[maxn];
std::string dp[141][51][21][21], trans[11];
namespace R {
inline std::string max(std::string a, std::string b) {
  if (a.length() != b.length()) return a.length() > b.length() ? a : b;
  return a > b ? a : b;
}
}  // namespace R
int main() {
  scanf("%d%s", &n, s + 1);
  for (int i = 2; i <= 9; i++) trans[i].push_back(i + 48);
  for (int i = 1; i <= n; i++) {
    for (int j = 2; j <= s[i] - 48; j++) {
      int now = j;
      if (now % 2 == 0) {
        while (now % 2 == 0) a[2]++, now /= 2;
      }
      if (now % 3 == 0) {
        while (now % 3 == 0) a[3]++, now /= 3;
      }
      if (now == 5) a[5]++;
      if (now == 7) a[7]++;
    }
  }
  dp[0][0][0][0] = "";
  for (int i = 0; i <= a[2]; i++) {
    for (int j = 0; j <= a[3]; j++) {
      for (int p = 0; p <= a[5]; p++) {
        for (int q = 0; q <= a[7]; q++) {
          if ((i || j || p || q) && dp[i][j][p][q] == "") continue;
          dp[i + 1][j][p][q] =
              R::max(dp[i + 1][j][p][q], trans[2] + dp[i][j][p][q]);
          dp[i + 1][j + 1][p][q] =
              R::max(dp[i + 1][j + 1][p][q], trans[3] + dp[i][j][p][q]);
          dp[i + 3][j + 1][p][q] =
              R::max(dp[i + 3][j + 1][p][q], trans[4] + dp[i][j][p][q]);
          dp[i + 3][j + 1][p + 1][q] =
              R::max(dp[i + 3][j + 1][p + 1][q], trans[5] + dp[i][j][p][q]);
          dp[i + 4][j + 2][p + 1][q] =
              R::max(dp[i + 4][j + 2][p + 1][q], trans[6] + dp[i][j][p][q]);
          dp[i + 4][j + 2][p + 1][q + 1] =
              R::max(dp[i + 4][j + 2][p + 1][q + 1], trans[7] + dp[i][j][p][q]);
          dp[i + 7][j + 2][p + 1][q + 1] =
              R::max(dp[i + 7][j + 2][p + 1][q + 1], trans[8] + dp[i][j][p][q]);
          dp[i + 7][j + 4][p + 1][q + 1] =
              R::max(dp[i + 7][j + 4][p + 1][q + 1], trans[9] + dp[i][j][p][q]);
        }
      }
    }
  }
  std::cout << dp[a[2]][a[3]][a[5]][a[7]] << std::endl;
  return 0;
}

```