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.
import java.io.*;
import java.util.*;
public class B
{
BufferedReader br;
BufferedWriter bw;
public static void main(String args[]) throws IOException
{
  (new B()).run();
}

void run() throws IOException
{
  br =new BufferedReader(new InputStreamReader(System.in));
  bw =new BufferedWriter(new OutputStreamWriter(System.out));
  // code starts here
  int n=toInt(line());
  String s=line();
  int i;
  ArrayList<Integer> div=new ArrayList<Integer>();
  for(i=2;i<=n;i++)
  if(n%i==0)
  {
      /*if(i*i==n)
      div.add(i);
      else
      {div.add(i);
      div.add(n/i);*/
      div.add(i);
    }

  //Collections.sort(div);
  for(i=0;i<div.size();i++)
  s=reverseSubstring(s,0,div.get(i));

  
  System.out.println(s);
 bw.flush();
}
public String reverseSubstring(String text, int startIndex, int endIndex) {
    String result = text.substring(0,startIndex); //before reversing
    result += new StringBuilder(text.substring(startIndex,endIndex)).reverse().toString(); //reversed part
    result += text.substring(endIndex); //after reversing
    return result;
}

String line() throws IOException
{
return br.readLine();
}
int[] na() throws IOException
{
String s[]=line().split(" ");
int len=s.length;
int ar[]=new int[len];
for(int i=0;i<len;i++)
ar[i]=toInt(s[i]);
return ar;
}

int[][] matrix(int n,int m) throws IOException
{
int ar[][]=new int[n][m];
for(int i=0;i<n;i++)
ar[i]=na();
return ar;
}
int toInt(String s) throws IOException
{
return Integer.parseInt(s);
} 
long toLong(String s) throws IOException
{
return Long.parseLong(s);
}
double toDouble(String s) throws IOException
{
return Double.parseDouble(s);
}
private void tr(Object... o) { System.out.println(Arrays.deepToString(o)); }
}