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.
factors = [[1], [1, 2], [1, 3], [1, 2, 4], [1, 5], [1, 2, 3, 6], [1, 7], [1, 2, 4, 8], [1, 3, 9], [1, 2, 5, 10], [1, 11], [1, 2, 3, 4, 6, 12], [1, 13], [1, 2, 7, 14], [1, 3, 5, 15], [1, 2, 4, 8, 16], [1, 17], [1, 2, 3, 6, 9, 18], [1, 19], [1, 2, 4, 5, 10, 20], [1, 3, 7, 21], [1, 2, 11, 22], [1, 23], [1, 2, 3, 4, 6, 8, 12, 24], [1, 5, 25], [1, 2, 13, 26], [1, 3, 9, 27], [1, 2, 4, 7, 14, 28], [1, 29], [1, 2, 3, 5, 6, 10, 15, 30], [1, 31], [1, 2, 4, 8, 16, 32], [1, 3, 11, 33], [1, 2, 17, 34], [1, 5, 7, 35], [1, 2, 3, 4, 6, 9, 12, 18, 36], [1, 37], [1, 2, 19, 38], [1, 3, 13, 39], [1, 2, 4, 5, 8, 10, 20, 40], [1, 41], [1, 2, 3, 6, 7, 14, 21, 42], [1, 43], [1, 2, 4, 11, 22, 44], [1, 3, 5, 9, 15, 45], [1, 2, 23, 46], [1, 47], [1, 2, 3, 4, 6, 8, 12, 16, 24, 48], [1, 7, 49], [1, 2, 5, 10, 25, 50], [1, 3, 17, 51], [1, 2, 4, 13, 26, 52], [1, 53], [1, 2, 3, 6, 9, 18, 27, 54], [1, 5, 11, 55], [1, 2, 4, 7, 8, 14, 28, 56], [1, 3, 19, 57], [1, 2, 29, 58], [1, 59], [1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60], [1, 61], [1, 2, 31, 62], [1, 3, 7, 9, 21, 63], [1, 2, 4, 8, 16, 32, 64], [1, 5, 13, 65], [1, 2, 3, 6, 11, 22, 33, 66], [1, 67], [1, 2, 4, 17, 34, 68], [1, 3, 23, 69], [1, 2, 5, 7, 10, 14, 35, 70], [1, 71], [1, 2, 3, 4, 6, 8, 9, 12, 18, 24, 36, 72], [1, 73], [1, 2, 37, 74], [1, 3, 5, 15, 25, 75], [1, 2, 4, 19, 38, 76], [1, 7, 11, 77], [1, 2, 3, 6, 13, 26, 39, 78], [1, 79], [1, 2, 4, 5, 8, 10, 16, 20, 40, 80], [1, 3, 9, 27, 81], [1, 2, 41, 82], [1, 83], [1, 2, 3, 4, 6, 7, 12, 14, 21, 28, 42, 84], [1, 5, 17, 85], [1, 2, 43, 86], [1, 3, 29, 87], [1, 2, 4, 8, 11, 22, 44, 88], [1, 89], [1, 2, 3, 5, 6, 9, 10, 15, 18, 30, 45, 90], [1, 7, 13, 91], [1, 2, 4, 23, 46, 92], [1, 3, 31, 93], [1, 2, 47, 94], [1, 5, 19, 95], [1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 96], [1, 97], [1, 2, 7, 14, 49, 98], [1, 3, 9, 11, 33, 99], [1, 2, 4, 5, 10, 20, 25, 50, 100]]

n = int(input())

s = input()

factor = factors[n - 1]

for num in factor:
	s = s[num - 1::-1] + s[num:]

print(s)