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;
template <typename T>
T gcd(T a, T b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
template <typename T>
T pow(T a, T b, long long m) {
  T ans = 1;
  while (b > 0) {
    if (b % 2 == 1) ans = (ans * a) % m;
    b /= 2;
    a = (a * a) % m;
  }
  return ans % m;
}
const long long inf = 1e18;
const long long minf = -(1e18);
const long long mod = 1e9 + 7;
const long long med = 1e9 + 9;
inline long long add(long long x, long long y) {
  x %= mod;
  y %= mod;
  x += y;
  if (x >= mod) x -= mod;
  return x;
}
inline long long sub(long long x, long long y) {
  x %= mod;
  y %= mod;
  x -= y;
  if (x < 0) x += mod;
  return x;
}
inline long long mul(long long x, long long y) {
  x %= mod;
  y %= mod;
  return (x * 1ll * y) % mod;
}
long long power(long long x, long long y) {
  if (y == 0) return 1;
  if (y == 1) return x;
  long long ans = power(x, y / 2) % mod;
  ans *= ans;
  ans %= mod;
  if (y % 2) ans *= x;
  return ans % mod;
}
long long inv(long long x, long long y) {
  x += mod;
  y += mod;
  x %= mod;
  y %= mod;
  long long ret = (power(y, mod - 2) % mod) * x;
  return (ret % mod);
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  int n;
  string s;
  cin >> n;
  cin >> s;
  for (int i = 1; i <= n; i++) {
    if (n % i == 0) {
      for (int j = 0; j <= (i - 1) / 2; j++) swap(s[j], s[i - 1 - j]);
    }
  }
  cout << s;
  return 0;
}
