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();
        char c = 'a';
        int a = 0;
        for(int i = 0;i < S.length();i++){
            if(S.charAt(i) != '1'){
                c = S.charAt(i);
                a = i+1;
                break;
            }
        }
        if(a == 0 || a > K)  System.out.println(1);
        else    System.out.println(c);
    }
} 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();
        char c = 'a';
        int a = 0;
        for(int i = 0;i < S.length();i++){
            if(S.charAt(i) != '1'){
                c = S.charAt(i);
                a = i+1;
                break;
            }
        }
        if(a == 0 || a > K)  System.out.println(1);
        else    System.out.println(c);
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        long K = sc.nextLong();
        char c = 'a';
        int a = 0;
        for(int i = 0;i < S.length();i++){
            if(S.charAt(i) != '1'){
                c = S.charAt(i);
                a = i+1;
                break;
            }
        }
        if(a == 0 || a > K)  System.out.println(1);
        else    System.out.println(c);
    } main {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        long K = sc.nextLong();
        char c = 'a';
        int a = 0;
        for(int i = 0;i < S.length();i++){
            if(S.charAt(i) != '1'){
                c = S.charAt(i);
                a = i+1;
                break;
            }
        }
        if(a == 0 || a > K)  System.out.println(1);
        else    System.out.println(c);
    } 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 char c = 'a'; c 'a' int a = 0; a 0 for(int i = 0;i < S.length();i++){
            if(S.charAt(i) != '1'){
                c = S.charAt(i);
                a = i+1;
                break;
            }
        } int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
            if(S.charAt(i) != '1'){
                c = S.charAt(i);
                a = i+1;
                break;
            }
        } {
            if(S.charAt(i) != '1'){
                c = S.charAt(i);
                a = i+1;
                break;
            }
        } if(S.charAt(i) != '1'){
                c = S.charAt(i);
                a = i+1;
                break;
            } S.charAt(i) != '1' S.charAt(i) S.charAt S i '1' {
                c = S.charAt(i);
                a = i+1;
                break;
            } c = S.charAt(i) c S.charAt(i) S.charAt S i a = i+1 a i+1 i 1 break; if(a == 0 || a > K)  System.out.println(1);
        else    System.out.println(c); a == 0 || a > K a == 0 a 0 a > K a K System.out.println(1) System.out.println System.out System System.out 1 System.out.println(c) System.out.println System.out System System.out c 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();
        char c = 'a';
        int a = 0;
        for(int i = 0;i < S.length();i++){
            if(S.charAt(i) != '1'){
                c = S.charAt(i);
                a = i+1;
                break;
            }
        }
        if(a == 0 || a > K)  System.out.println(1);
        else    System.out.println(c);
    }
} public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        long K = sc.nextLong();
        char c = 'a';
        int a = 0;
        for(int i = 0;i < S.length();i++){
            if(S.charAt(i) != '1'){
                c = S.charAt(i);
                a = i+1;
                break;
            }
        }
        if(a == 0 || a > K)  System.out.println(1);
        else    System.out.println(c);
    }
} 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();
        char c = 'a';
        int a = 0;
        for(int i = 0;i < S.length();i++){
            if(S.charAt(i) != '1'){
                c = S.charAt(i);
                a = i+1;
                break;
            }
        }
        if(a == 0 || a > K)  System.out.println(1);
        else    System.out.println(c);
    }
}