import java.util.Scanner;

/**
 * HJ46 截取字符串
 */
public class HJ046 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            String str = sc.next();
            int k = sc.nextInt();
            System.out.println(str.substring(0, k));
        }
        sc.close();
    }
}