A string s of length n can be encrypted by the following algorithm:

  * iterate over all divisors of n in decreasing order (i.e. from n to 1), 
  * for each divisor d, reverse the substring s[1 ... d] (i.e. the substring which starts at position 1 and ends at position d). 



For example, the above algorithm applied to the string s="codeforces" leads to the following changes: "codeforces" → "secrofedoc" → "orcesfedoc" → "rocesfedoc" → "rocesfedoc" (obviously, the last reverse operation doesn't change the string because d=1).

You are given the encrypted string t. Your task is to decrypt this string, i.e., to find a string s such that the above algorithm results in string t. It can be proven that this string s always exists and is unique.

Input

The first line of input consists of a single integer n (1 ≤ n ≤ 100) — the length of the string t. The second line of input consists of the string t. The length of t is n, and it consists only of lowercase Latin letters.

Output

Print a string s such that the above algorithm results in t.

Examples

Input

10
rocesfedoc


Output

codeforces


Input

16
plmaetwoxesisiht


Output

thisisexampletwo


Input

1
z


Output

z

Note

The first example is described in the problem statement.
#include <bits/stdc++.h>
using namespace std;
int gcd(int x, int y) {
  if (y == 0) {
    return x;
  }
  return gcd(y, x % y);
}
long long int lgcd(long long int x, long long int y) {
  if (y == 0) {
    return x;
  }
  return lgcd(y, x % y);
}
long long int pow(long long int a, long long int b,
                  long long int m = 1000000007) {
  long long int res = 1;
  while (b > 0) {
    if (b & 1) {
      res = (res * a) % m;
    }
    a = (a * a) % m;
    b >>= 1;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  string s;
  cin >> n;
  cin >> s;
  string ans(n, 'a');
  int st = 0;
  int end = n - 1;
  int isst = 0;
  int i;
  for (i = n - 1; i >= 0; i--) {
    if (n % (i + 1) == 0) {
      isst = 1 - isst;
      if (isst) {
        ans[st] = s[i];
        st++;
      } else {
        ans[end] = s[i];
        end--;
      }
    } else {
      if (isst) {
        ans[st] = s[i];
        st++;
      } else {
        ans[end] = s[i];
        end--;
      }
    }
  }
  cout << ans;
  return 0;
}
