S = str(input())
w = int(input())
print(''.join([S[i * w] for i in range(-(-len(S) // w))]))

4186434ee8b68448e723192b1a4498b9e2133e61
<mask token>

<mask token>
print(''.join([S[i * w] for i in range(-(-len(S) // w))]))

S = str(input())
w = int(input())
print(''.join([S[i * w] for i in range(-(-len(S) // w))]))
