import java.util.Scanner;

public class Main {
    public static void main(String args[]) {
        try (Scanner in = new Scanner(System.in)) {
            String S = in.next();
            long K = in.nextLong();

            int index = 1;
            for (int i = 0; i < S.length(); i++) {
                char n = S.charAt(i);
                if (n == '1') {
                    if (K >= index && K < index + 1) {
                        System.out.println(n);
                        return;
                    } else {
                        index++;
                    }
                } else {
                    System.out.println(n);
                    return;
                }
            }
        }
    }

} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String args[]) {
        try (Scanner in = new Scanner(System.in)) {
            String S = in.next();
            long K = in.nextLong();

            int index = 1;
            for (int i = 0; i < S.length(); i++) {
                char n = S.charAt(i);
                if (n == '1') {
                    if (K >= index && K < index + 1) {
                        System.out.println(n);
                        return;
                    } else {
                        index++;
                    }
                } else {
                    System.out.println(n);
                    return;
                }
            }
        }
    }

} Main public static void main(String args[]) {
        try (Scanner in = new Scanner(System.in)) {
            String S = in.next();
            long K = in.nextLong();

            int index = 1;
            for (int i = 0; i < S.length(); i++) {
                char n = S.charAt(i);
                if (n == '1') {
                    if (K >= index && K < index + 1) {
                        System.out.println(n);
                        return;
                    } else {
                        index++;
                    }
                } else {
                    System.out.println(n);
                    return;
                }
            }
        }
    } main {
        try (Scanner in = new Scanner(System.in)) {
            String S = in.next();
            long K = in.nextLong();

            int index = 1;
            for (int i = 0; i < S.length(); i++) {
                char n = S.charAt(i);
                if (n == '1') {
                    if (K >= index && K < index + 1) {
                        System.out.println(n);
                        return;
                    } else {
                        index++;
                    }
                } else {
                    System.out.println(n);
                    return;
                }
            }
        }
    } try (Scanner in = new Scanner(System.in)) {
            String S = in.next();
            long K = in.nextLong();

            int index = 1;
            for (int i = 0; i < S.length(); i++) {
                char n = S.charAt(i);
                if (n == '1') {
                    if (K >= index && K < index + 1) {
                        System.out.println(n);
                        return;
                    } else {
                        index++;
                    }
                } else {
                    System.out.println(n);
                    return;
                }
            }
        } {
            String S = in.next();
            long K = in.nextLong();

            int index = 1;
            for (int i = 0; i < S.length(); i++) {
                char n = S.charAt(i);
                if (n == '1') {
                    if (K >= index && K < index + 1) {
                        System.out.println(n);
                        return;
                    } else {
                        index++;
                    }
                } else {
                    System.out.println(n);
                    return;
                }
            }
        } Scanner in = new Scanner(System.in) Scanner in = new Scanner(System.in) new Scanner(System.in) String S = in.next(); S in.next() in.next in long K = in.nextLong(); K in.nextLong() in.nextLong in int index = 1; index 1 for (int i = 0; i < S.length(); i++) {
                char n = S.charAt(i);
                if (n == '1') {
                    if (K >= index && K < index + 1) {
                        System.out.println(n);
                        return;
                    } else {
                        index++;
                    }
                } else {
                    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 {
                char n = S.charAt(i);
                if (n == '1') {
                    if (K >= index && K < index + 1) {
                        System.out.println(n);
                        return;
                    } else {
                        index++;
                    }
                } else {
                    System.out.println(n);
                    return;
                }
            } {
                char n = S.charAt(i);
                if (n == '1') {
                    if (K >= index && K < index + 1) {
                        System.out.println(n);
                        return;
                    } else {
                        index++;
                    }
                } else {
                    System.out.println(n);
                    return;
                }
            } char n = S.charAt(i); n S.charAt(i) S.charAt S i if (n == '1') {
                    if (K >= index && K < index + 1) {
                        System.out.println(n);
                        return;
                    } else {
                        index++;
                    }
                } else {
                    System.out.println(n);
                    return;
                } n == '1' n '1' {
                    if (K >= index && K < index + 1) {
                        System.out.println(n);
                        return;
                    } else {
                        index++;
                    }
                } if (K >= index && K < index + 1) {
                        System.out.println(n);
                        return;
                    } else {
                        index++;
                    } K >= index && K < index + 1 K >= index K index K < index + 1 K index + 1 index 1 {
                        System.out.println(n);
                        return;
                    } System.out.println(n) System.out.println System.out System System.out n return; {
                        index++;
                    } index++ index {
                    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[]) {
        try (Scanner in = new Scanner(System.in)) {
            String S = in.next();
            long K = in.nextLong();

            int index = 1;
            for (int i = 0; i < S.length(); i++) {
                char n = S.charAt(i);
                if (n == '1') {
                    if (K >= index && K < index + 1) {
                        System.out.println(n);
                        return;
                    } else {
                        index++;
                    }
                } else {
                    System.out.println(n);
                    return;
                }
            }
        }
    }

} public class Main {
    public static void main(String args[]) {
        try (Scanner in = new Scanner(System.in)) {
            String S = in.next();
            long K = in.nextLong();

            int index = 1;
            for (int i = 0; i < S.length(); i++) {
                char n = S.charAt(i);
                if (n == '1') {
                    if (K >= index && K < index + 1) {
                        System.out.println(n);
                        return;
                    } else {
                        index++;
                    }
                } else {
                    System.out.println(n);
                    return;
                }
            }
        }
    }

} Main
import java.util.Scanner;

public class Main {
    public static void main(String args[]) {
        try (Scanner in = new Scanner(System.in)) {
            String S = in.next();
            long K = in.nextLong();

            int index = 1;
            for (int i = 0; i < S.length(); i++) {
                char n = S.charAt(i);
                if (n == '1') {
                    if (K >= index && K < index + 1) {
                        System.out.println(n);
                        return;
                    } else {
                        index++;
                    }
                } else {
                    System.out.println(n);
                    return;
                }
            }
        }
    }

}
