Yet Another Strong Problem

Tahseen testing contest
Limits 1s, 512 MB

You are given a string str\text{str} consisting of characters 00 and/or 11 with an arbitrary integer nn.

Without any reason, I want to evaluate this following function with the value str\text{str} and nn. Unfortunately, my function stops working for larger values. Can you help me to find the actual output of this function?

N.B: it is guaranteed initial str\text{str} will have zero in the first and last position, and the indices are zero-based on the above function.

Input

The input is composed of two lines.

The first line of the input contains a string, str\text{str}(1str100)(1\le |\text{str}| \le 100) — The first parameter of the function, mentioned in the statement.

The second line contains an integer, n(0n260)n (0\le n \le 2^{60})— the second parameter of the function.

Output

Print the string, output of the function, in a single line.

Sample

InputOutput
0001011010
10

0010110010

Submit

Login to submit.

Statistics

33% Solution Ratio
AlveRahmanEarliest, 1M ago
MrBrionixFastest, 0.0s
MrBrionixLightest, 5.5 kB
MrBrionixShortest, 1088B
Toph uses cookies. By continuing you agree to our Cookie Policy.