import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long K = Long.parseLong(sc.next());
        long gosencho = 5000000000000000l;

        long cur = 0;
        for (int i = 0; i < s.length(); i++) {
            long n = s.charAt(i) - 48;
            cur += Math.pow(n, gosencho);
            if (cur >= K) {
                System.out.println(n);
                return;
            }
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long K = Long.parseLong(sc.next());
        long gosencho = 5000000000000000l;

        long cur = 0;
        for (int i = 0; i < s.length(); i++) {
            long n = s.charAt(i) - 48;
            cur += Math.pow(n, gosencho);
            if (cur >= K) {
                System.out.println(n);
                return;
            }
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long K = Long.parseLong(sc.next());
        long gosencho = 5000000000000000l;

        long cur = 0;
        for (int i = 0; i < s.length(); i++) {
            long n = s.charAt(i) - 48;
            cur += Math.pow(n, gosencho);
            if (cur >= K) {
                System.out.println(n);
                return;
            }
        }
    } main {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long K = Long.parseLong(sc.next());
        long gosencho = 5000000000000000l;

        long cur = 0;
        for (int i = 0; i < s.length(); i++) {
            long n = s.charAt(i) - 48;
            cur += Math.pow(n, gosencho);
            if (cur >= K) {
                System.out.println(n);
                return;
            }
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc long K = Long.parseLong(sc.next()); K Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc long gosencho = 5000000000000000l; gosencho 5000000000000000l long cur = 0; cur 0 for (int i = 0; i < s.length(); i++) {
            long n = s.charAt(i) - 48;
            cur += Math.pow(n, gosencho);
            if (cur >= K) {
                System.out.println(n);
                return;
            }
        } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
            long n = s.charAt(i) - 48;
            cur += Math.pow(n, gosencho);
            if (cur >= K) {
                System.out.println(n);
                return;
            }
        } {
            long n = s.charAt(i) - 48;
            cur += Math.pow(n, gosencho);
            if (cur >= K) {
                System.out.println(n);
                return;
            }
        } long n = s.charAt(i) - 48; n s.charAt(i) - 48 s.charAt(i) s.charAt s i 48 cur += Math.pow(n, gosencho) cur Math.pow(n, gosencho) Math.pow Math n gosencho if (cur >= K) {
                System.out.println(n);
                return;
            } cur >= K cur K {
                System.out.println(n);
                return;
            } System.out.println(n) System.out.println System.out System System.out n return; String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long K = Long.parseLong(sc.next());
        long gosencho = 5000000000000000l;

        long cur = 0;
        for (int i = 0; i < s.length(); i++) {
            long n = s.charAt(i) - 48;
            cur += Math.pow(n, gosencho);
            if (cur >= K) {
                System.out.println(n);
                return;
            }
        }
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long K = Long.parseLong(sc.next());
        long gosencho = 5000000000000000l;

        long cur = 0;
        for (int i = 0; i < s.length(); i++) {
            long n = s.charAt(i) - 48;
            cur += Math.pow(n, gosencho);
            if (cur >= K) {
                System.out.println(n);
                return;
            }
        }
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long K = Long.parseLong(sc.next());
        long gosencho = 5000000000000000l;

        long cur = 0;
        for (int i = 0; i < s.length(); i++) {
            long n = s.charAt(i) - 48;
            cur += Math.pow(n, gosencho);
            if (cur >= K) {
                System.out.println(n);
                return;
            }
        }
    }
}
