You are given a string S consisting of lowercase English letters. We will write down this string, starting a new line after every w letters. Print the string obtained by concatenating the letters at the beginnings of these lines from top to bottom.

line = input()
w = int(input())

length = len(line)

out = ""

for i in range(len(line) // w):
    out += line[i*w]

print(out)


line = input()
w = int(input())

out = ""

div = len(line) // w
mod = len(line) % w

for i in range(div):
    out += line[i*w]

if mod != 0:
    out += line[div*w]

print(out)
