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 C {

	public static void main(String[] args) {
		FastScanner sc = new FastScanner(System.in);
		int n = sc.nextInt();
		char c[] = sc.next().toCharArray();
		for (int i = 2; i <= n; i++) {
			if (n % i == 0) {
				for (int k = 0; k < i / 2; k++) {
					char ch = c[k];
					c[k] = c[i - k - 1];
					c[i - k - 1] = ch;
				}
			}
		}
		for(int i=0;i<n;i++){
			System.out.print(c[i]);
		}
		System.out.println();
	}

	static class FastScanner {
		private final InputStream is;
		private StringBuilder sB = new StringBuilder(1 << 13);
		private byte[] buf = new byte[1 << 13];
		private int bufLen;
		private int bufOffset;
		private int next;

		public FastScanner(InputStream is) {
			this.is = is;
		}

		private int read() {
			while (bufLen == bufOffset) {
				bufOffset = 0;
				try {
					bufLen = is.read(buf);
				} catch (IOException e) {
					bufLen = -1;
				}
				if (bufLen == -1) {
					return -1;
				}
			}
			return buf[bufOffset++];
		}

		public void skipBlank() {
			while (next >= 0 && next <= 32) {
				next = read();
			}
		}

		public int nextInt() {
			int sign = 1;
			skipBlank();
			if (next == '+' || next == '-') {
				sign = next == '+' ? 1 : -1;
				next = read();
			}
			int val = 0;
			if (sign == 1) {
				while (next >= '0' && next <= '9') {
					val = val * 10 + next - '0';
					next = read();
				}
			} else {
				while (next >= '0' && next <= '9') {
					val = val * 10 - next + '0';
					next = read();
				}
			}
			return val;
		}

		public String readString(StringBuilder builder) {
			skipBlank();
			while (next > 32) {
				builder.append((char) next);
				next = read();
			}
			return builder.toString();
		}

		public String next() {
			sB.setLength(0);
			return readString(sB);
		}
	}

	static class FastOutput implements AutoCloseable, Closeable, Appendable {
		private static final int THRESHOLD = 1 << 13;
		private final Writer os;
		private StringBuilder cache = new StringBuilder(THRESHOLD * 2);

		public FastOutput append(CharSequence csq) {
			cache.append(csq);
			return this;
		}

		public FastOutput append(CharSequence csq, int start, int end) {
			cache.append(csq, start, end);
			return this;
		}

		private void afterWrite() {
			if (cache.length() < THRESHOLD) {
				return;
			}
			flush();
		}

		public FastOutput(Writer os) {
			this.os = os;
		}

		public FastOutput(OutputStream os) {
			this(new OutputStreamWriter(os));
		}

		public FastOutput append(char c) {
			cache.append(c);
			afterWrite();
			return this;
		}

		public FastOutput append(int c) {
			cache.append(c);
			afterWrite();
			return this;
		}

		public FastOutput append(String c) {
			cache.append(c);
			afterWrite();
			return this;
		}

		public FastOutput println(String c) {
			return append(c).println();
		}

		public FastOutput println() {
			return append(System.lineSeparator());
		}

		public FastOutput flush() {
			try {
				os.append(cache);
				os.flush();
				cache.setLength(0);
			} catch (IOException e) {
				throw new UncheckedIOException(e);
			}
			return this;
		}

		public void close() {
			flush();
			try {
				os.close();
			} catch (IOException e) {
				throw new UncheckedIOException(e);
			}
		}

		public String toString() {
			return cache.toString();
		}
	}
}
