A. Repeating Cipher
Polycarp loves ciphers. He has invented his own cipher called repeating.
Repeating cipher is used for strings. To encrypt the string s=s1s2…sms=s1s2…sm (1≤m≤101≤m≤10), Polycarp uses the following algorithm:
he writes down s1s1 ones,
he writes down s2s2 twice,
he writes down s3s3 three times,
…
he writes down smsm mm times.
For example, if ss=“bab” the process is: “b” →→ “baa” →→ “baabbb”. So the encrypted ss=“bab” is “baabbb”.
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 first line contains integer nn (1≤n≤551≤n≤55) — the length of the encrypted string. The second 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 exactly nn.
It is guaranteed that the answer to the test exists.
Output
Print such string ss that after encryption it equals tt.
Examples
inputCopy
6
baabbb
outputCopy
bab
inputCopy
10
ooopppssss
outputCopy
oops
inputCopy
1
z
outputCopy
z
#include <iostream>
#include <string>
using namespace std;
int main()
{
int n;
while(cin >> n)
{
string s;
cin >> s;
int num = 1;
for(int i = 0; i < n; ++i)
{
cout << s[i];
i += num;
num++;
}
cout << '\n';
}
return 0;
}