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 \dots 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" $\to$ "secrofedoc" $\to$ "orcesfedoc" $\to$ "rocesfedoc" $\to$ "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 \le n \le 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.

Difficulty: introductory

Starter code:

Solutions:
n = int(input())
s = input()
for d in range(1, n+1):
    if n%d == 0:
        t1 = s[:d]
        t2 = s[d:]
        s = t1[::-1] + t2
print(s)

n = int(input())
s = input()
for i in range(1, n + 1):
  if n % i == 0:
    s = s[i-1::-1] + s[i:]
print(s)


l = int(input())
s = input()
for i in range(1,l+1):
	if (l%i)==0:
		temp = s[:i]
		s = temp[::-1] + s[i:]
print(s)

n=int(input())
a=list(input().strip())
i=1
while(i<=n):
    if(n%i==0):
        a=a[:i][::-1]+a[i:]
    i+=1
print("".join(a))

n=int(input())
s=input()
for x in range(1,n+1):
    if(n%x==0):
        #print(x,s[:x])
        s=s[:x][::-1]+s[x:]
print(s)


n = int(input())
s = input()
for i in range(1, n + 1):
    if n % i == 0: s = s[:i][::-1] + s[i:]
print(s)


n = int(input())
string = input()

divisors = []
for i in range(1, n + 1):
    if n % i == 0:
        divisors.append(i)
        
for d in divisors:
    string = string[:d][::-1] + string[d:]
    
print(string)

n=int(input())
s=input()
for i in range(2,n+1):
  if(n%i==0):
    t = s[:i]
    t = t[::-1]
    tt = s[i:]
    s = t+tt
print(s)

n=int(input())
t=input()
for i in range(1,n+1):
    if n%i==0:
        l=t[0:i]
        ost=t[i:]
        l=l[::-1]
        t=l+ost
print(t)

n = int(input())
s = input()
for d in range(2, n + 1):
    if n % d == 0:
        s = s[d - 1::-1] + s[d:]
print(s)


def go():
    n = int(input())
    s = [i for i in input()]
    for i in range(1, n + 1):
        if n % i == 0:
            s[0:i] = s[0:i][::-1]
    return ''.join(s)
print(go())


n = int(input().strip())
s = input()

for d in range(1, n + 1):
    if n % d == 0:
        s = s[:d][::-1] + s[d:]

print(s)


n = int(input())
t = list(input())

for i in range(1, n + 1):
    if n % i == 0:
        t[:i] = t[:i][::-1]

print(''.join(t))


n=int(input())
t=list(map(str,input()))
for i in range(1,n+1):
    if n%i==0:
        t=t[:i][::-1]+t[i:]
for i in t:
    print(i,end='')


n = int(input())
s = input()

for i in range(2,n+1):
    if(n%i==0):
        d = ""
        for j in range(i-1,-1,-1):
            d =  d + s[j]
        d += s[i:]
        s = d
print(s)

def d(n):
    z = [1]
    for i in range(2,n//2+1):
        if n%i==0:
            z.append(i)
    z.append(n)
    return z
n = int(input())
t = list(input())
z = d(n)
#z.reverse()
for i in z:
    k = t[:i]
    k.reverse()
    t = k + t[i:]
for i in range(n):
    print(t[i],end='')

a = int(input())
str_inp = str(input())

for i in range(1, a+1):
	if a%i == 0:
		str_inp = ''.join(reversed(str_inp[0:i])) + str_inp[i:a]

print(str_inp)


n = int(input())
s = input()
arr = []
for i in range(n):
    arr.append(s[i])
for i in range(1, n + 1):
    if n % i == 0:
        arr = list(reversed(arr[:i])) + arr[i:]
print(*arr, sep='')

n = int(input())
s = input()
for i in range(1, n + 1):
    if n % i == 0:
        s = s[:i][::-1] + s[i:]
print(s)

def divi(n):
    l = []
    for i in range(1,n+1):
        if(n%i==0):
            l.append(i)
    return l

n = int(input())
s = input()
sl = [i for i in s]
l = divi(n)
for i in l:
    x = sl[:i]
    sl[:i] = x[::-1]

ans = ''
for i in sl:
    ans+=i

print(ans)


import math;
import random;
import time;
import heapq;
def getIntList():
    return list(map(int, input().split()));
def getTransIntList(n):
    first=getIntList();
    m=len(first);
    result=[[0]*n for _ in range(m)];
    for i in range(m):
        result[i][0]=first[i];
    for j in range(1, n):
        curr=getIntList();
        for i in range(m):
            result[i][j]=curr[i];
    return result;
n = int(input());
t= input();
for d in range(1, n+1):
    if n%d==0:
        t1=t[:d];
        t=t1[::-1]+t[d:];
print(t);


n = int(input())
s = input()
div = 1

while div<=n:
    if n%div==0:
        tmp = s[:div]
        s = tmp[::-1] + s[div:]
    div += 1

print(s)


n = int(input())
a = input()
d = []
for i in range(2,n+1):
    if n % i == 0:
        d.append(i)
for i in d:
    j = a[:i]
    j = j[::-1]
  #  print(j)
    a = j + a[i:]
print(a)


n = int(input())
t = input()
for i in range(1, n + 1):
    if n % i == 0:
        t = t[0:i][::-1] + t[i:]
print(t)

n = int(input())
s = list(input())
for i in range(1, n + 1):
    if n % i == 0:
        t = s[:i]
        s[:i] = t[::-1]
print("".join(s))