import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String S= sc.next();
        String[] SArray = new String[S.length()];
        long K=sc.nextLong();
        long num=0;
        for (int i = 0; i < S.length(); i++) {
            SArray[i] = String.valueOf(S.charAt(i));
            int a=Integer.parseInt(SArray[i]);
            if(a!=1)num +=K+1;
            else num++;
            if(num>=K){
                System.out.println(SArray[i]);
                return;
            }
        }
        
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String S= sc.next();
        String[] SArray = new String[S.length()];
        long K=sc.nextLong();
        long num=0;
        for (int i = 0; i < S.length(); i++) {
            SArray[i] = String.valueOf(S.charAt(i));
            int a=Integer.parseInt(SArray[i]);
            if(a!=1)num +=K+1;
            else num++;
            if(num>=K){
                System.out.println(SArray[i]);
                return;
            }
        }
        
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String S= sc.next();
        String[] SArray = new String[S.length()];
        long K=sc.nextLong();
        long num=0;
        for (int i = 0; i < S.length(); i++) {
            SArray[i] = String.valueOf(S.charAt(i));
            int a=Integer.parseInt(SArray[i]);
            if(a!=1)num +=K+1;
            else num++;
            if(num>=K){
                System.out.println(SArray[i]);
                return;
            }
        }
        
    } main {
        Scanner sc = new Scanner(System.in);
        String S= sc.next();
        String[] SArray = new String[S.length()];
        long K=sc.nextLong();
        long num=0;
        for (int i = 0; i < S.length(); i++) {
            SArray[i] = String.valueOf(S.charAt(i));
            int a=Integer.parseInt(SArray[i]);
            if(a!=1)num +=K+1;
            else num++;
            if(num>=K){
                System.out.println(SArray[i]);
                return;
            }
        }
        
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S= sc.next(); S sc.next() sc.next sc String[] SArray = new String[S.length()]; SArray new String[S.length()] S.length() S.length S long K=sc.nextLong(); K sc.nextLong() sc.nextLong sc long num=0; num 0 for (int i = 0; i < S.length(); i++) {
            SArray[i] = String.valueOf(S.charAt(i));
            int a=Integer.parseInt(SArray[i]);
            if(a!=1)num +=K+1;
            else num++;
            if(num>=K){
                System.out.println(SArray[i]);
                return;
            }
        } int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
            SArray[i] = String.valueOf(S.charAt(i));
            int a=Integer.parseInt(SArray[i]);
            if(a!=1)num +=K+1;
            else num++;
            if(num>=K){
                System.out.println(SArray[i]);
                return;
            }
        } {
            SArray[i] = String.valueOf(S.charAt(i));
            int a=Integer.parseInt(SArray[i]);
            if(a!=1)num +=K+1;
            else num++;
            if(num>=K){
                System.out.println(SArray[i]);
                return;
            }
        } SArray[i] = String.valueOf(S.charAt(i)) SArray[i] SArray i String.valueOf(S.charAt(i)) String.valueOf String S.charAt(i) S.charAt S i int a=Integer.parseInt(SArray[i]); a Integer.parseInt(SArray[i]) Integer.parseInt Integer SArray[i] SArray i if(a!=1)num +=K+1;
            else num++; a!=1 a 1 num +=K+1 num K+1 K 1 num++ num if(num>=K){
                System.out.println(SArray[i]);
                return;
            } num>=K num K {
                System.out.println(SArray[i]);
                return;
            } System.out.println(SArray[i]) System.out.println System.out System System.out SArray[i] SArray i return; String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String S= sc.next();
        String[] SArray = new String[S.length()];
        long K=sc.nextLong();
        long num=0;
        for (int i = 0; i < S.length(); i++) {
            SArray[i] = String.valueOf(S.charAt(i));
            int a=Integer.parseInt(SArray[i]);
            if(a!=1)num +=K+1;
            else num++;
            if(num>=K){
                System.out.println(SArray[i]);
                return;
            }
        }
        
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String S= sc.next();
        String[] SArray = new String[S.length()];
        long K=sc.nextLong();
        long num=0;
        for (int i = 0; i < S.length(); i++) {
            SArray[i] = String.valueOf(S.charAt(i));
            int a=Integer.parseInt(SArray[i]);
            if(a!=1)num +=K+1;
            else num++;
            if(num>=K){
                System.out.println(SArray[i]);
                return;
            }
        }
        
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String S= sc.next();
        String[] SArray = new String[S.length()];
        long K=sc.nextLong();
        long num=0;
        for (int i = 0; i < S.length(); i++) {
            SArray[i] = String.valueOf(S.charAt(i));
            int a=Integer.parseInt(SArray[i]);
            if(a!=1)num +=K+1;
            else num++;
            if(num>=K){
                System.out.println(SArray[i]);
                return;
            }
        }
        
    }
}
