#include <cstdio>
#include <cstring>

char s[1005];

int main() {
	int w;
	scanf("%s", s);
	scanf("%d", &w);
	int len = strlen(s);
	for (int i = 0; i < len; i += w) printf("%c", s[i]);
	printf("\n");
	return 0;
}