CF1085A.Right-Left Cipher

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

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 .

输入格式

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.

输出格式

Print such string ss that after encryption it equals tt .

输入输出样例

  • 输入#1

    ncteho
    

    输出#1

    techno
    
  • 输入#2

    erfdcoeocs
    

    输出#2

    codeforces
    
  • 输入#3

    z
    

    输出#3

    z
    
首页