import java.util.Scanner;


public class Main {

    public static void find(final String s, final long k) {
        if (s.length() == 1) {
            System.out.println(s.charAt(0));
            return;
        }
        if (s.charAt(0) == '1') {
            if (k <= 1) {
                System.out.println(1);
            } else {
                find(s.substring(1), k - 1);
            }
        } else {
            System.out.println(s.charAt(0));
        }
    }

    public static void main(String[] args){
        final Scanner sc = new Scanner(System.in);
        final String s = sc.next();
        final long k = sc.nextLong();
        find(s, k);
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void find(final String s, final long k) {
        if (s.length() == 1) {
            System.out.println(s.charAt(0));
            return;
        }
        if (s.charAt(0) == '1') {
            if (k <= 1) {
                System.out.println(1);
            } else {
                find(s.substring(1), k - 1);
            }
        } else {
            System.out.println(s.charAt(0));
        }
    }

    public static void main(String[] args){
        final Scanner sc = new Scanner(System.in);
        final String s = sc.next();
        final long k = sc.nextLong();
        find(s, k);
    }
} Main public static void find(final String s, final long k) {
        if (s.length() == 1) {
            System.out.println(s.charAt(0));
            return;
        }
        if (s.charAt(0) == '1') {
            if (k <= 1) {
                System.out.println(1);
            } else {
                find(s.substring(1), k - 1);
            }
        } else {
            System.out.println(s.charAt(0));
        }
    } find {
        if (s.length() == 1) {
            System.out.println(s.charAt(0));
            return;
        }
        if (s.charAt(0) == '1') {
            if (k <= 1) {
                System.out.println(1);
            } else {
                find(s.substring(1), k - 1);
            }
        } else {
            System.out.println(s.charAt(0));
        }
    } if (s.length() == 1) {
            System.out.println(s.charAt(0));
            return;
        } s.length() == 1 s.length() s.length s 1 {
            System.out.println(s.charAt(0));
            return;
        } System.out.println(s.charAt(0)) System.out.println System.out System System.out s.charAt(0) s.charAt s 0 return; if (s.charAt(0) == '1') {
            if (k <= 1) {
                System.out.println(1);
            } else {
                find(s.substring(1), k - 1);
            }
        } else {
            System.out.println(s.charAt(0));
        } s.charAt(0) == '1' s.charAt(0) s.charAt s 0 '1' {
            if (k <= 1) {
                System.out.println(1);
            } else {
                find(s.substring(1), k - 1);
            }
        } if (k <= 1) {
                System.out.println(1);
            } else {
                find(s.substring(1), k - 1);
            } k <= 1 k 1 {
                System.out.println(1);
            } System.out.println(1) System.out.println System.out System System.out 1 {
                find(s.substring(1), k - 1);
            } find(s.substring(1), k - 1) find s.substring(1) s.substring s 1 k - 1 k 1 {
            System.out.println(s.charAt(0));
        } System.out.println(s.charAt(0)) System.out.println System.out System System.out s.charAt(0) s.charAt s 0 final String s s final long k k public static void main(String[] args){
        final Scanner sc = new Scanner(System.in);
        final String s = sc.next();
        final long k = sc.nextLong();
        find(s, k);
    } main {
        final Scanner sc = new Scanner(System.in);
        final String s = sc.next();
        final long k = sc.nextLong();
        find(s, k);
    } final Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final String s = sc.next(); s sc.next() sc.next sc final long k = sc.nextLong(); k sc.nextLong() sc.nextLong sc find(s, k) find s k String[] args args public class Main {

    public static void find(final String s, final long k) {
        if (s.length() == 1) {
            System.out.println(s.charAt(0));
            return;
        }
        if (s.charAt(0) == '1') {
            if (k <= 1) {
                System.out.println(1);
            } else {
                find(s.substring(1), k - 1);
            }
        } else {
            System.out.println(s.charAt(0));
        }
    }

    public static void main(String[] args){
        final Scanner sc = new Scanner(System.in);
        final String s = sc.next();
        final long k = sc.nextLong();
        find(s, k);
    }
} public class Main {

    public static void find(final String s, final long k) {
        if (s.length() == 1) {
            System.out.println(s.charAt(0));
            return;
        }
        if (s.charAt(0) == '1') {
            if (k <= 1) {
                System.out.println(1);
            } else {
                find(s.substring(1), k - 1);
            }
        } else {
            System.out.println(s.charAt(0));
        }
    }

    public static void main(String[] args){
        final Scanner sc = new Scanner(System.in);
        final String s = sc.next();
        final long k = sc.nextLong();
        find(s, k);
    }
} Main
import java.util.Scanner;


public class Main {

    public static void find(final String s, final long k) {
        if (s.length() == 1) {
            System.out.println(s.charAt(0));
            return;
        }
        if (s.charAt(0) == '1') {
            if (k <= 1) {
                System.out.println(1);
            } else {
                find(s.substring(1), k - 1);
            }
        } else {
            System.out.println(s.charAt(0));
        }
    }

    public static void main(String[] args){
        final Scanner sc = new Scanner(System.in);
        final String s = sc.next();
        final long k = sc.nextLong();
        find(s, k);
    }
}
