CF1085A.Right-Left Cipher

传统题 时间 2000 ms 内存 256 MiB 3 尝试 1 已通过 1 标签

Right-Left Cipher

Polycarp loves ciphers. He has invented his own cipher called Right-Left.

Right-Left cipher is used for strings. To encrypt the string s=s1s2sns=s_{1}s_{2} \dots s_{n} Polycarp uses the following algorithm:

  • he writes down s1s_1,
  • he appends the current word with s2s_2 (i.e. writes down s2s_2 to the right of the current result),
  • he prepends the current word with s3s_3 (i.e. writes down s3s_3 to the left of the current result),
  • he appends the current word with s4s_4 (i.e. writes down s4s_4 to the right of the current result),
  • he prepends the current word with s5s_5 (i.e. writes down s5s_5 to the left of the current result),
  • and so on for each position until the end of ss.

For example, if ss="techno" the process is: "t" \to "te" \to "cte" \to "cteh" \to "ncteh" \to "ncteho". So the encrypted ss="techno" is "ncteho".

Given string tt — the result of encryption of some string ss. Your task is to decrypt it, i.e. find the string ss.

Input

The only line of the input contains tt — the result of encryption of some string ss. It contains only lowercase Latin letters. The length of tt is between 11 and 5050, inclusive.

Output

Print such string ss that after encryption it equals tt.

Samples

ncteho
techno
erfdcoeocs
codeforces
z
z

在线编程 IDE

建议全屏模式获得最佳体验