import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        k = Math.min(k , (long) 100);
        sc.close();
        int n = -1;
        while(k > 0){
            n++;
            k--;
            if(s.charAt(n) != '1'){
                k = -2;
                System.out.println(s.charAt(n));
            }else{
            }
        }
        if(k != -2){
            System.out.println(1);
        }
    }
} import java.util.*; util.* java public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        k = Math.min(k , (long) 100);
        sc.close();
        int n = -1;
        while(k > 0){
            n++;
            k--;
            if(s.charAt(n) != '1'){
                k = -2;
                System.out.println(s.charAt(n));
            }else{
            }
        }
        if(k != -2){
            System.out.println(1);
        }
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        k = Math.min(k , (long) 100);
        sc.close();
        int n = -1;
        while(k > 0){
            n++;
            k--;
            if(s.charAt(n) != '1'){
                k = -2;
                System.out.println(s.charAt(n));
            }else{
            }
        }
        if(k != -2){
            System.out.println(1);
        }
    } main {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        k = Math.min(k , (long) 100);
        sc.close();
        int n = -1;
        while(k > 0){
            n++;
            k--;
            if(s.charAt(n) != '1'){
                k = -2;
                System.out.println(s.charAt(n));
            }else{
            }
        }
        if(k != -2){
            System.out.println(1);
        }
    } 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 k = Math.min(k , (long) 100) k Math.min(k , (long) 100) Math.min Math k (long) 100 sc.close() sc.close sc int n = -1; n -1 1 while(k > 0){
            n++;
            k--;
            if(s.charAt(n) != '1'){
                k = -2;
                System.out.println(s.charAt(n));
            }else{
            }
        } k > 0 k 0 {
            n++;
            k--;
            if(s.charAt(n) != '1'){
                k = -2;
                System.out.println(s.charAt(n));
            }else{
            }
        } n++ n k-- k if(s.charAt(n) != '1'){
                k = -2;
                System.out.println(s.charAt(n));
            }else{
            } s.charAt(n) != '1' s.charAt(n) s.charAt s n '1' {
                k = -2;
                System.out.println(s.charAt(n));
            } k = -2 k -2 2 System.out.println(s.charAt(n)) System.out.println System.out System System.out s.charAt(n) s.charAt s n {
            } if(k != -2){
            System.out.println(1);
        } k != -2 k -2 2 {
            System.out.println(1);
        } System.out.println(1) System.out.println System.out System System.out 1 String[] args args public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        k = Math.min(k , (long) 100);
        sc.close();
        int n = -1;
        while(k > 0){
            n++;
            k--;
            if(s.charAt(n) != '1'){
                k = -2;
                System.out.println(s.charAt(n));
            }else{
            }
        }
        if(k != -2){
            System.out.println(1);
        }
    }
} public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        k = Math.min(k , (long) 100);
        sc.close();
        int n = -1;
        while(k > 0){
            n++;
            k--;
            if(s.charAt(n) != '1'){
                k = -2;
                System.out.println(s.charAt(n));
            }else{
            }
        }
        if(k != -2){
            System.out.println(1);
        }
    }
} Main
import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        k = Math.min(k , (long) 100);
        sc.close();
        int n = -1;
        while(k > 0){
            n++;
            k--;
            if(s.charAt(n) != '1'){
                k = -2;
                System.out.println(s.charAt(n));
            }else{
            }
        }
        if(k != -2){
            System.out.println(1);
        }
    }
}