import javax.print.DocFlavor;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.function.BiConsumer;

public class Main {

    //グローバル変数を定義

    public static void main(String[] args) throws IOException {
        new Main().run();
    }

    void run() {
        Scanner sc = new Scanner(System.in);
        String input = sc.next();
        String k = sc.next();

        if(k.equals("1")) {
            System.out.println(input.charAt(0));
            return;
        }

        for(int i=0; i<Long.parseLong(k); i++){
            if(input.charAt(i) == '1'){
                continue;
            } else {
                System.out.println(input.charAt(i));
                return;
            }
        }
        System.out.println("1");
    }
} import javax.print.DocFlavor; DocFlavor javax.print import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.math.BigDecimal; BigDecimal java.math import java.math.BigInteger; BigInteger java.math import java.nio.charset.StandardCharsets; StandardCharsets java.nio.charset import java.util.*; util.* java import java.util.function.BiConsumer; BiConsumer java.util.function public class Main {

    //グローバル変数を定義

    public static void main(String[] args) throws IOException {
        new Main().run();
    }

    void run() {
        Scanner sc = new Scanner(System.in);
        String input = sc.next();
        String k = sc.next();

        if(k.equals("1")) {
            System.out.println(input.charAt(0));
            return;
        }

        for(int i=0; i<Long.parseLong(k); i++){
            if(input.charAt(i) == '1'){
                continue;
            } else {
                System.out.println(input.charAt(i));
                return;
            }
        }
        System.out.println("1");
    }
} Main public static void main(String[] args) throws IOException {
        new Main().run();
    } main {
        new Main().run();
    } new Main().run() new Main().run new Main() String[] args args void run() {
        Scanner sc = new Scanner(System.in);
        String input = sc.next();
        String k = sc.next();

        if(k.equals("1")) {
            System.out.println(input.charAt(0));
            return;
        }

        for(int i=0; i<Long.parseLong(k); i++){
            if(input.charAt(i) == '1'){
                continue;
            } else {
                System.out.println(input.charAt(i));
                return;
            }
        }
        System.out.println("1");
    } run {
        Scanner sc = new Scanner(System.in);
        String input = sc.next();
        String k = sc.next();

        if(k.equals("1")) {
            System.out.println(input.charAt(0));
            return;
        }

        for(int i=0; i<Long.parseLong(k); i++){
            if(input.charAt(i) == '1'){
                continue;
            } else {
                System.out.println(input.charAt(i));
                return;
            }
        }
        System.out.println("1");
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String input = sc.next(); input sc.next() sc.next sc String k = sc.next(); k sc.next() sc.next sc if(k.equals("1")) {
            System.out.println(input.charAt(0));
            return;
        } k.equals("1") k.equals k "1" {
            System.out.println(input.charAt(0));
            return;
        } System.out.println(input.charAt(0)) System.out.println System.out System System.out input.charAt(0) input.charAt input 0 return; for(int i=0; i<Long.parseLong(k); i++){
            if(input.charAt(i) == '1'){
                continue;
            } else {
                System.out.println(input.charAt(i));
                return;
            }
        } int i=0; int i=0; i 0 i<Long.parseLong(k) i Long.parseLong(k) Long.parseLong Long k i++ i++ i {
            if(input.charAt(i) == '1'){
                continue;
            } else {
                System.out.println(input.charAt(i));
                return;
            }
        } {
            if(input.charAt(i) == '1'){
                continue;
            } else {
                System.out.println(input.charAt(i));
                return;
            }
        } if(input.charAt(i) == '1'){
                continue;
            } else {
                System.out.println(input.charAt(i));
                return;
            } input.charAt(i) == '1' input.charAt(i) input.charAt input i '1' {
                continue;
            } continue; {
                System.out.println(input.charAt(i));
                return;
            } System.out.println(input.charAt(i)) System.out.println System.out System System.out input.charAt(i) input.charAt input i return; System.out.println("1") System.out.println System.out System System.out "1" public class Main {

    //グローバル変数を定義

    public static void main(String[] args) throws IOException {
        new Main().run();
    }

    void run() {
        Scanner sc = new Scanner(System.in);
        String input = sc.next();
        String k = sc.next();

        if(k.equals("1")) {
            System.out.println(input.charAt(0));
            return;
        }

        for(int i=0; i<Long.parseLong(k); i++){
            if(input.charAt(i) == '1'){
                continue;
            } else {
                System.out.println(input.charAt(i));
                return;
            }
        }
        System.out.println("1");
    }
} public class Main {

    //グローバル変数を定義

    public static void main(String[] args) throws IOException {
        new Main().run();
    }

    void run() {
        Scanner sc = new Scanner(System.in);
        String input = sc.next();
        String k = sc.next();

        if(k.equals("1")) {
            System.out.println(input.charAt(0));
            return;
        }

        for(int i=0; i<Long.parseLong(k); i++){
            if(input.charAt(i) == '1'){
                continue;
            } else {
                System.out.println(input.charAt(i));
                return;
            }
        }
        System.out.println("1");
    }
} Main
import javax.print.DocFlavor;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.function.BiConsumer;

public class Main {

    //グローバル変数を定義

    public static void main(String[] args) throws IOException {
        new Main().run();
    }

    void run() {
        Scanner sc = new Scanner(System.in);
        String input = sc.next();
        String k = sc.next();

        if(k.equals("1")) {
            System.out.println(input.charAt(0));
            return;
        }

        for(int i=0; i<Long.parseLong(k); i++){
            if(input.charAt(i) == '1'){
                continue;
            } else {
                System.out.println(input.charAt(i));
                return;
            }
        }
        System.out.println("1");
    }
}
