import java.util.*;

public class Main {

    public static void main(String[] args) {
        long days = 500000000000000L;
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        long K = sc.nextLong();
        long temp = 0;

        for (int i = 0; i<S.length(); i++) {
            long target = S.charAt(i) - '0';
            //System.out.println(target);

            temp += Math.pow(target, days);

            if (temp >= K) {
                System.out.println(target);
              	return;
            }
        }
    }
} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        long days = 500000000000000L;
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        long K = sc.nextLong();
        long temp = 0;

        for (int i = 0; i<S.length(); i++) {
            long target = S.charAt(i) - '0';
            //System.out.println(target);

            temp += Math.pow(target, days);

            if (temp >= K) {
                System.out.println(target);
              	return;
            }
        }
    }
} Main public static void main(String[] args) {
        long days = 500000000000000L;
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        long K = sc.nextLong();
        long temp = 0;

        for (int i = 0; i<S.length(); i++) {
            long target = S.charAt(i) - '0';
            //System.out.println(target);

            temp += Math.pow(target, days);

            if (temp >= K) {
                System.out.println(target);
              	return;
            }
        }
    } main {
        long days = 500000000000000L;
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        long K = sc.nextLong();
        long temp = 0;

        for (int i = 0; i<S.length(); i++) {
            long target = S.charAt(i) - '0';
            //System.out.println(target);

            temp += Math.pow(target, days);

            if (temp >= K) {
                System.out.println(target);
              	return;
            }
        }
    } long days = 500000000000000L; days 500000000000000L Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc long K = sc.nextLong(); K sc.nextLong() sc.nextLong sc long temp = 0; temp 0 for (int i = 0; i<S.length(); i++) {
            long target = S.charAt(i) - '0';
            //System.out.println(target);

            temp += Math.pow(target, days);

            if (temp >= K) {
                System.out.println(target);
              	return;
            }
        } int i = 0; int i = 0; i 0 i<S.length() i S.length() S.length S i++ i++ i {
            long target = S.charAt(i) - '0';
            //System.out.println(target);

            temp += Math.pow(target, days);

            if (temp >= K) {
                System.out.println(target);
              	return;
            }
        } {
            long target = S.charAt(i) - '0';
            //System.out.println(target);

            temp += Math.pow(target, days);

            if (temp >= K) {
                System.out.println(target);
              	return;
            }
        } long target = S.charAt(i) - '0'; target S.charAt(i) - '0' S.charAt(i) S.charAt S i '0' temp += Math.pow(target, days) temp Math.pow(target, days) Math.pow Math target days if (temp >= K) {
                System.out.println(target);
              	return;
            } temp >= K temp K {
                System.out.println(target);
              	return;
            } System.out.println(target) System.out.println System.out System System.out target return; String[] args args public class Main {

    public static void main(String[] args) {
        long days = 500000000000000L;
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        long K = sc.nextLong();
        long temp = 0;

        for (int i = 0; i<S.length(); i++) {
            long target = S.charAt(i) - '0';
            //System.out.println(target);

            temp += Math.pow(target, days);

            if (temp >= K) {
                System.out.println(target);
              	return;
            }
        }
    }
} public class Main {

    public static void main(String[] args) {
        long days = 500000000000000L;
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        long K = sc.nextLong();
        long temp = 0;

        for (int i = 0; i<S.length(); i++) {
            long target = S.charAt(i) - '0';
            //System.out.println(target);

            temp += Math.pow(target, days);

            if (temp >= K) {
                System.out.println(target);
              	return;
            }
        }
    }
} Main
import java.util.*;

public class Main {

    public static void main(String[] args) {
        long days = 500000000000000L;
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        long K = sc.nextLong();
        long temp = 0;

        for (int i = 0; i<S.length(); i++) {
            long target = S.charAt(i) - '0';
            //System.out.println(target);

            temp += Math.pow(target, days);

            if (temp >= K) {
                System.out.println(target);
              	return;
            }
        }
    }
}
