#include <bits/stdc++.h>
using namespace std;

int main(){
  string s;
  cin >> s;
  int w;
  cin >> w;
  int n=1;
  if(w==1){
    cout << s << endl;
    return 0;
  }
  for(int i=0; i<s.size(); i++){
    if(n%w==1) cout << s[i];
    n++;
  }
  cout << endl;
}
      


#include <bits/stdc++.h>
using namespace std;

#define REP(i, n) for (ll (i) = 0 ; (i) < (ll)(n) ; ++(i))
#define REPN(i, m, n) for (ll (i) = m ; (i) < (ll)(n) ; ++(i))
#define REP_REV(i, n) for (ll (i) = (ll)(n) - 1 ; (i) >= 0 ; --(i))
#define REPN_REV(i, m, n) for (ll (i) = (ll)(n) - 1 ; (i) >= m ; --(i))

#define INF             2e9
#define INF_LL          1LL<<60
#define ll              long long
#define Ceil(x, n)      (((((x))+((n)-1))/n))
#define CeilN(x, n)     (((((x))+((n)-1))/n)*n)
#define FloorN(x, n)    ((x)-(x)%(n))
#define ALL(x)          (x).begin(),(x).end()
typedef pair<ll, ll>    P;

int main() {
    string s;
    int w;
    cin >> s >> w;
    vector<char> ans;
    REP(i, s.size()) {
        if(i % w == 0) {
            ans.push_back(s[i]);
        }
    }

    REP(i, ans.size()) cout << ans[i];
    cout << endl;
    return 0;
}