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

int main()
{
    string s;
    int n;
    cin >> s;
    cin >> n;

    for(int i = 0; i < s.length(); i+=n)
    {
        cout << s[i];
    }

    cout << endl;

}
