#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0;i<int(N);++i)
using ll = long long;
const int INF = 2147483647;
// const ll INF = 1000000000000000000LL;

int main() {
	string s;
	cin >> s;
	int w;
	cin >> w;
	rep(i,s.size()){
		cout << s[i];
		i+=w-1;
	}
	cout << endl;
	return 0;
}


#include <iostream>
#include <cstdio>
using namespace std;

string s;
int w;
int main() {
	cin >> s >> w;
	for(int i=0; s[i]; i++) {
		if(i%w==0) putchar(s[i]);
	}
	return 0;
}