#include <stdio.h>

int main() {
    char arr[1000] = " ";
    int n = 0;
    scanf("%s %d",arr,&n);
    for(int i = 0;i<n;i++)
    {
        printf("%c",arr[i]);
    }
    return 0;
}