S = input()
w = int(input())
print(''.join([s for s in S[::w]]))

1779bc81c7ae0316a46ed8106639e5b6d0b717d3
<mask token>

<mask token>
print(''.join([s for s in S[::w]]))

S = input()
w = int(input())
print(''.join([s for s in S[::w]]))
