#include <bits/stdc++.h>
using namespace std;
const int N = 15;
int n, p[4] = {2, 3, 5, 7};
string a;
int fcnt[10][4], cnt[4] = {0, 0, 0, 0};
int dp[110][100][30][30], back[110][100][30][30];
bool vst[110][100][30][30];
bool found = false;
vector<int> ans, stk;
int dfs(int c1, int c2, int c3, int c4) {
  if (vst[c1][c2][c3][c4]) return dp[c1][c2][c3][c4];
  vst[c1][c2][c3][c4] = true;
  bool found = false;
  for (int i = 2; i <= 9; i++) {
    int f1 = fcnt[i][0], f2 = fcnt[i][1], f3 = fcnt[i][2], f4 = fcnt[i][3];
    if (c1 < f1 || c2 < f2 || c3 < f3 || c4 < f4) continue;
    int prev_dp = dfs(c1 - f1, c2 - f2, c3 - f3, c4 - f4);
    if (prev_dp != -1) found = true;
    if (prev_dp != -1 && prev_dp + 1 > dp[c1][c2][c3][c4]) {
      dp[c1][c2][c3][c4] = prev_dp + 1;
      back[c1][c2][c3][c4] = i;
    }
  }
  if (!found) dp[c1][c2][c3][c4] = -1;
  return dp[c1][c2][c3][c4];
}
int main(void) {
  cin >> n;
  cin >> a;
  for (int i = 0; i < n; i++) {
    char c = a[i];
    int digit = (int)(c - '0');
    int fact = 1;
    while (digit >= 1) {
      fact *= digit;
      digit--;
    }
    for (int j = 0; j < 4; j++) {
      while (fact % p[j] == 0) {
        cnt[j]++;
        fact /= p[j];
      }
    }
  }
  for (int i = 2; i <= 9; i++) {
    int fact = 1;
    for (int j = 1; j <= i; j++) fact *= j;
    for (int j = 0; j < 4; j++) {
      while (fact % p[j] == 0) {
        fcnt[i][j]++;
        fact /= p[j];
      }
    }
  }
  vst[0][0][0][0] = true;
  int A = dfs(cnt[0], cnt[1], cnt[2], cnt[3]);
  int B = A;
  int c1 = cnt[0], c2 = cnt[1], c3 = cnt[2], c4 = cnt[3];
  while (A--) {
    int b = back[c1][c2][c3][c4];
    ans.push_back(b);
    c1 -= fcnt[b][0], c2 -= fcnt[b][1], c3 -= fcnt[b][2], c4 -= fcnt[b][3];
  }
  for (int i = B - 1; i >= 0; i--) cout << ans[i];
  cout << "\n";
  return 0;
}

### Prompt

Construct a Cpp code solution to the problem outlined:

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>
using namespace std;
const int N = 15;
int n, p[4] = {2, 3, 5, 7};
string a;
int fcnt[10][4], cnt[4] = {0, 0, 0, 0};
int dp[110][100][30][30], back[110][100][30][30];
bool vst[110][100][30][30];
bool found = false;
vector<int> ans, stk;
int dfs(int c1, int c2, int c3, int c4) {
  if (vst[c1][c2][c3][c4]) return dp[c1][c2][c3][c4];
  vst[c1][c2][c3][c4] = true;
  bool found = false;
  for (int i = 2; i <= 9; i++) {
    int f1 = fcnt[i][0], f2 = fcnt[i][1], f3 = fcnt[i][2], f4 = fcnt[i][3];
    if (c1 < f1 || c2 < f2 || c3 < f3 || c4 < f4) continue;
    int prev_dp = dfs(c1 - f1, c2 - f2, c3 - f3, c4 - f4);
    if (prev_dp != -1) found = true;
    if (prev_dp != -1 && prev_dp + 1 > dp[c1][c2][c3][c4]) {
      dp[c1][c2][c3][c4] = prev_dp + 1;
      back[c1][c2][c3][c4] = i;
    }
  }
  if (!found) dp[c1][c2][c3][c4] = -1;
  return dp[c1][c2][c3][c4];
}
int main(void) {
  cin >> n;
  cin >> a;
  for (int i = 0; i < n; i++) {
    char c = a[i];
    int digit = (int)(c - '0');
    int fact = 1;
    while (digit >= 1) {
      fact *= digit;
      digit--;
    }
    for (int j = 0; j < 4; j++) {
      while (fact % p[j] == 0) {
        cnt[j]++;
        fact /= p[j];
      }
    }
  }
  for (int i = 2; i <= 9; i++) {
    int fact = 1;
    for (int j = 1; j <= i; j++) fact *= j;
    for (int j = 0; j < 4; j++) {
      while (fact % p[j] == 0) {
        fcnt[i][j]++;
        fact /= p[j];
      }
    }
  }
  vst[0][0][0][0] = true;
  int A = dfs(cnt[0], cnt[1], cnt[2], cnt[3]);
  int B = A;
  int c1 = cnt[0], c2 = cnt[1], c3 = cnt[2], c4 = cnt[3];
  while (A--) {
    int b = back[c1][c2][c3][c4];
    ans.push_back(b);
    c1 -= fcnt[b][0], c2 -= fcnt[b][1], c3 -= fcnt[b][2], c4 -= fcnt[b][3];
  }
  for (int i = B - 1; i >= 0; i--) cout << ans[i];
  cout << "\n";
  return 0;
}

```