import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        char[] c = str.toCharArray();
        long k = sc.nextLong();
        
        int onelast = -1;
        char next = 'a';
        for (int i = 0; i < c.length; i++) {
            if (c[i] != '1') {
                next = c[i];
                break;
            }
            onelast = i;
        }
        onelast++;
        
        if (k <= onelast) {
            System.out.println(1);
        } else {
            System.out.println(next);
        }
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        char[] c = str.toCharArray();
        long k = sc.nextLong();
        
        int onelast = -1;
        char next = 'a';
        for (int i = 0; i < c.length; i++) {
            if (c[i] != '1') {
                next = c[i];
                break;
            }
            onelast = i;
        }
        onelast++;
        
        if (k <= onelast) {
            System.out.println(1);
        } else {
            System.out.println(next);
        }
    }
} Main public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        char[] c = str.toCharArray();
        long k = sc.nextLong();
        
        int onelast = -1;
        char next = 'a';
        for (int i = 0; i < c.length; i++) {
            if (c[i] != '1') {
                next = c[i];
                break;
            }
            onelast = i;
        }
        onelast++;
        
        if (k <= onelast) {
            System.out.println(1);
        } else {
            System.out.println(next);
        }
    } main {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        char[] c = str.toCharArray();
        long k = sc.nextLong();
        
        int onelast = -1;
        char next = 'a';
        for (int i = 0; i < c.length; i++) {
            if (c[i] != '1') {
                next = c[i];
                break;
            }
            onelast = i;
        }
        onelast++;
        
        if (k <= onelast) {
            System.out.println(1);
        } else {
            System.out.println(next);
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String str = sc.next(); str sc.next() sc.next sc char[] c = str.toCharArray(); c str.toCharArray() str.toCharArray str long k = sc.nextLong(); k sc.nextLong() sc.nextLong sc int onelast = -1; onelast -1 1 char next = 'a'; next 'a' for (int i = 0; i < c.length; i++) {
            if (c[i] != '1') {
                next = c[i];
                break;
            }
            onelast = i;
        } int i = 0; int i = 0; i 0 i < c.length i c.length c c.length i++ i++ i {
            if (c[i] != '1') {
                next = c[i];
                break;
            }
            onelast = i;
        } {
            if (c[i] != '1') {
                next = c[i];
                break;
            }
            onelast = i;
        } if (c[i] != '1') {
                next = c[i];
                break;
            } c[i] != '1' c[i] c i '1' {
                next = c[i];
                break;
            } next = c[i] next c[i] c i break; onelast = i onelast i onelast++ onelast if (k <= onelast) {
            System.out.println(1);
        } else {
            System.out.println(next);
        } k <= onelast k onelast {
            System.out.println(1);
        } System.out.println(1) System.out.println System.out System System.out 1 {
            System.out.println(next);
        } System.out.println(next) System.out.println System.out System System.out next String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        char[] c = str.toCharArray();
        long k = sc.nextLong();
        
        int onelast = -1;
        char next = 'a';
        for (int i = 0; i < c.length; i++) {
            if (c[i] != '1') {
                next = c[i];
                break;
            }
            onelast = i;
        }
        onelast++;
        
        if (k <= onelast) {
            System.out.println(1);
        } else {
            System.out.println(next);
        }
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        char[] c = str.toCharArray();
        long k = sc.nextLong();
        
        int onelast = -1;
        char next = 'a';
        for (int i = 0; i < c.length; i++) {
            if (c[i] != '1') {
                next = c[i];
                break;
            }
            onelast = i;
        }
        onelast++;
        
        if (k <= onelast) {
            System.out.println(1);
        } else {
            System.out.println(next);
        }
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        char[] c = str.toCharArray();
        long k = sc.nextLong();
        
        int onelast = -1;
        char next = 'a';
        for (int i = 0; i < c.length; i++) {
            if (c[i] != '1') {
                next = c[i];
                break;
            }
            onelast = i;
        }
        onelast++;
        
        if (k <= onelast) {
            System.out.println(1);
        } else {
            System.out.println(next);
        }
    }
}
