#include <bits/stdc++.h>
int n;
char str[20];
int dp[107][64][17][17];
bool visited[107][64][17][17];
int ar[10][4], primes[] = {2, 3, 5, 7};
void Generate() {
  memset(ar, 0, sizeof(ar));
  int i, j, k;
  for (i = 2; i < 10; i++) {
    int x = i;
    for (k = 0; k < 4; k++) {
      while ((x % primes[k]) == 0) {
        x /= primes[k];
        ar[i][k]++;
      }
      ar[i][k] += ar[i - 1][k];
    }
  }
}
int F(int rem[4]) {
  if (!rem[0] && !rem[1] && !rem[2] && !rem[3]) return 0;
  if (visited[rem[0]][rem[1]][rem[2]][rem[3]])
    return dp[rem[0]][rem[1]][rem[2]][rem[3]];
  int temp[4] = {0};
  int i, j, x, res = (-(1 << 25));
  for (i = 9; i > 1; i--) {
    bool flag = true;
    for (j = 0; j < 4; j++) {
      temp[j] = rem[j] - ar[i][j];
      if (temp[j] < 0) {
        flag = false;
        break;
      }
    }
    if (flag) {
      int x = 1 + F(temp);
      if (x > res) {
        res = x;
      }
    }
  }
  visited[rem[0]][rem[1]][rem[2]][rem[3]] = true;
  return (dp[rem[0]][rem[1]][rem[2]][rem[3]] = res);
}
void backtrack(int rem[4]) {
  if (!rem[0] && !rem[1] && !rem[2] && !rem[3]) return;
  int temp[4] = {0};
  int i, j, x, idx, res = (-(1 << 25));
  for (i = 9; i > 1; i--) {
    bool flag = true;
    for (j = 0; j < 4; j++) {
      temp[j] = rem[j] - ar[i][j];
      if (temp[j] < 0) {
        flag = false;
        break;
      }
    }
    if (flag) {
      int x = 1 + F(temp);
      if (x > res) {
        res = x;
        idx = i;
      }
    }
  }
  printf("%d", idx);
  i = idx;
  for (j = 0; j < 4; j++) {
    temp[j] = rem[j] - ar[i][j];
  }
  backtrack(temp);
}
int main() {
  Generate();
  int i, j, k, rem[4] = {0};
  while (scanf("%d", &n) != EOF) {
    scanf("%s", str);
    memset(rem, 0, sizeof(rem));
    for (i = 0; i < n; i++) {
      int x = str[i] - 48;
      for (j = 0; j < 4; j++) {
        rem[j] += ar[x][j];
      }
    }
    memset(visited, 0, sizeof(visited));
    int res = F(rem);
    backtrack(rem);
    puts("");
  }
  return 0;
}

### Prompt

Create a solution in cpp for 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>
int n;
char str[20];
int dp[107][64][17][17];
bool visited[107][64][17][17];
int ar[10][4], primes[] = {2, 3, 5, 7};
void Generate() {
  memset(ar, 0, sizeof(ar));
  int i, j, k;
  for (i = 2; i < 10; i++) {
    int x = i;
    for (k = 0; k < 4; k++) {
      while ((x % primes[k]) == 0) {
        x /= primes[k];
        ar[i][k]++;
      }
      ar[i][k] += ar[i - 1][k];
    }
  }
}
int F(int rem[4]) {
  if (!rem[0] && !rem[1] && !rem[2] && !rem[3]) return 0;
  if (visited[rem[0]][rem[1]][rem[2]][rem[3]])
    return dp[rem[0]][rem[1]][rem[2]][rem[3]];
  int temp[4] = {0};
  int i, j, x, res = (-(1 << 25));
  for (i = 9; i > 1; i--) {
    bool flag = true;
    for (j = 0; j < 4; j++) {
      temp[j] = rem[j] - ar[i][j];
      if (temp[j] < 0) {
        flag = false;
        break;
      }
    }
    if (flag) {
      int x = 1 + F(temp);
      if (x > res) {
        res = x;
      }
    }
  }
  visited[rem[0]][rem[1]][rem[2]][rem[3]] = true;
  return (dp[rem[0]][rem[1]][rem[2]][rem[3]] = res);
}
void backtrack(int rem[4]) {
  if (!rem[0] && !rem[1] && !rem[2] && !rem[3]) return;
  int temp[4] = {0};
  int i, j, x, idx, res = (-(1 << 25));
  for (i = 9; i > 1; i--) {
    bool flag = true;
    for (j = 0; j < 4; j++) {
      temp[j] = rem[j] - ar[i][j];
      if (temp[j] < 0) {
        flag = false;
        break;
      }
    }
    if (flag) {
      int x = 1 + F(temp);
      if (x > res) {
        res = x;
        idx = i;
      }
    }
  }
  printf("%d", idx);
  i = idx;
  for (j = 0; j < 4; j++) {
    temp[j] = rem[j] - ar[i][j];
  }
  backtrack(temp);
}
int main() {
  Generate();
  int i, j, k, rem[4] = {0};
  while (scanf("%d", &n) != EOF) {
    scanf("%s", str);
    memset(rem, 0, sizeof(rem));
    for (i = 0; i < n; i++) {
      int x = str[i] - 48;
      for (j = 0; j < 4; j++) {
        rem[j] += ar[x][j];
      }
    }
    memset(visited, 0, sizeof(visited));
    int res = F(rem);
    backtrack(rem);
    puts("");
  }
  return 0;
}

```