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.IOException; 
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*; 

public class Main 
{ 	
	private static Reader r; 	
	public static void main(String[] args) 	throws Exception 	
	{ 		
		r = new Reader(); 		
		r.readLine(); 		

		int n = r.readInt(0);

		List<Integer> divs = getDivs(n);
		Collections.sort(divs/*, Collections.reverseOrder()*/);

		r.readLine();
		char arr[] = r.readString(0).toCharArray();
		
		for (int div:divs)
			reverseOrSwap(arr, 0, div - 1);
			
		System.out.println(new String(arr));

		r.close(); 
	}

	public static List<Integer> getDivs(int n)
	{
		List<Integer> divs = new ArrayList<>();

		for (int i=1; i <= Math.sqrt(n); i++) 
		{ 
			if (n % i == 0) 
			{ 
				if (n / i == i) 
					divs.add(i);
				else  
				{
					divs.add(i);
					divs.add(n / i);
				}
			} 
		} 
		return divs;
	}

	public static void reverseOrSwap(char arr[], int fr, int to)
	{
		int step = (to - fr) / 2;
		for (int i=0;i <= step;++i)
		{
			char temp = arr[i];
			arr[i] = arr[to - i];
			arr[to - i] = temp;
		}

	}

} 

class Pair implements Comparable<Pair>
{ 	
	int f,s; 	
	public Pair() 	
	{} 
	public Pair(int f, int s) 	
	{ 	
		this.f = f; 	
		this.s = s; 	
	} 

	@Override 	
	public String toString() 
	{ 		
		return f + " " + s; 	
	} 	

	@Override 	
	public int compareTo(Pair o) 	
	{ 		
		// TODO: Implement this method 		
		if (f == o.f) 			
			return s - o.s; 		
		return f - o.f; 	
	} 
}

class Reader
{ 	
	private BufferedReader reader; 
	private String line[]; 	

	public Reader() 	
	{ 		
		reader = new BufferedReader(new InputStreamReader(System.in)); 	
	} 	

	public String[] getLine() 	
	{ 		
		return line; 	
	} 	

	public void readLine() 	throws IOException 
	{ 		
		line = reader.readLine().split(" "); 	
	} 	

	public int readInt(int pos)throws IOException 	
	{ 		
		return Integer.parseInt(line[pos]); 	
	} 	

	public double readDouble(int pos)throws IOException 	
	{ 		
		return Double.parseDouble(line[pos]); 	
	} 	

	public long readLong(int pos)throws IOException 
	{ 		
		return Long.parseLong(line[pos]); 
	} 	

	public String readString(int pos)throws IOException 	
	{ 		
		return line[pos]; 	
	} 	

	public void close()throws IOException 
	{ 		
		reader.close(); 	
	}

}