{"raw_statement":[{"iden":"statement","content":"A string $s$ of length $n$ can be encrypted by the following algorithm:\n\n*   iterate over all divisors of $n$ in decreasing order (i.e. from $n$ to $1$),\n*   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$).\n\nFor 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$).\n\nYou 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."},{"iden":"input","content":"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."},{"iden":"output","content":"Print a string $s$ such that the above algorithm results in $t$."},{"iden":"examples","content":"Input\n\n10\nrocesfedoc\n\nOutput\n\ncodeforces\n\nInput\n\n16\nplmaetwoxesisiht\n\nOutput\n\nthisisexampletwo\n\nInput\n\n1\nz\n\nOutput\n\nz"},{"iden":"note","content":"The first example is described in the problem statement."}],"translated_statement":[{"iden":"statement","content":"长度为 $n$ 的字符串 $s$ 可以通过以下算法加密：\n\n例如，将上述算法应用于字符串 $s$=\"_codeforces_\" 会得到以下变化：\"_codeforces_\" $arrow.r$ \"_secrofedoc_\" $arrow.r$ \"_orcesfedoc_\" $arrow.r$ \"_rocesfedoc_\" $arrow.r$ \"_rocesfedoc_\"（显然，最后一次反转操作不会改变字符串，因为 $d = 1$）。\n\n给你一个加密后的字符串 $t$。你的任务是解密这个字符串，即找到一个字符串 $s$，使得上述算法的结果为字符串 $t$。可以证明，这样的字符串 $s$ 总是存在且唯一。\n\n输入的第一行包含一个整数 $n$（$1 lt.eq n lt.eq 100$）——字符串 $t$ 的长度。第二行包含字符串 $t$。$t$ 的长度为 $n$，且仅由小写拉丁字母组成。\n\n请输出一个字符串 $s$，使得上述算法的结果为 $t$。\n\n第一个示例已在题目描述中给出。\n\n"},{"iden":"input","content":"输入的第一行包含一个整数 $n$（$1 lt.eq n lt.eq 100$）——字符串 $t$ 的长度。第二行包含字符串 $t$。$t$ 的长度为 $n$，且仅由小写拉丁字母组成。"},{"iden":"output","content":"请输出一个字符串 $s$，使得上述算法的结果为 $t$。"},{"iden":"examples","content":"输入10rocesfedocOutputcodeforces输入16plmaetwoxesisihtOutputthisisexampletwo输入1zOutputz"},{"iden":"note","content":"第一个示例已在题目描述中给出。"}],"sample_group":[],"show_order":[],"formal_statement":"Let $ n \\in \\mathbb{N} $, $ 1 \\leq n \\leq 100 $, and let $ t \\in \\Sigma^n $, where $ \\Sigma = \\{a, b, \\dots, z\\} $, be the encrypted string.\n\nDefine the encryption algorithm $ E: \\Sigma^n \\to \\Sigma^n $ as follows:\n\nLet $ s \\in \\Sigma^n $ be the original string.  \nFor $ k = 1 $ to $ n $:  \n Let $ d = \\left\\lfloor \\frac{n - k}{2} \\right\\rfloor + 1 $.  \n Reverse the substring $ s[d : n - d + 1] $ (1-indexed).\n\nThen $ t = E(s) $.\n\nGiven $ t $, find the unique $ s \\in \\Sigma^n $ such that $ E(s) = t $.\n\nEquivalently, define the inverse algorithm $ E^{-1} $:  \nFor $ k = n $ down to $ 1 $:  \n Let $ d = \\left\\lfloor \\frac{n - k}{2} \\right\\rfloor + 1 $.  \n Reverse the substring $ t[d : n - d + 1] $ (1-indexed).\n\nThen $ s = E^{-1}(t) $.\n\n**Objective:** Compute $ s = E^{-1}(t) $.","simple_statement":null,"has_page_source":false}