import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {
    private static java.util.Scanner scanner = new java.util.Scanner(System.in);

    public static void main(String[] args) {
        String s = scanner.next();
        long k = scanner.nextLong();
        Matcher matcher = Pattern.compile("[2-9]").matcher(s);
        if (matcher.find() && matcher.start() < k) {
            System.out.println(matcher.group());
        } else {
            System.out.println(1);
        }
    }
} import java.util.regex.Matcher; Matcher java.util.regex import java.util.regex.Pattern; Pattern java.util.regex public class Main {
    private static java.util.Scanner scanner = new java.util.Scanner(System.in);

    public static void main(String[] args) {
        String s = scanner.next();
        long k = scanner.nextLong();
        Matcher matcher = Pattern.compile("[2-9]").matcher(s);
        if (matcher.find() && matcher.start() < k) {
            System.out.println(matcher.group());
        } else {
            System.out.println(1);
        }
    }
} Main private static java.util.Scanner scanner = new java.util.Scanner(System.in); scanner new java.util.Scanner(System.in) public static void main(String[] args) {
        String s = scanner.next();
        long k = scanner.nextLong();
        Matcher matcher = Pattern.compile("[2-9]").matcher(s);
        if (matcher.find() && matcher.start() < k) {
            System.out.println(matcher.group());
        } else {
            System.out.println(1);
        }
    } main {
        String s = scanner.next();
        long k = scanner.nextLong();
        Matcher matcher = Pattern.compile("[2-9]").matcher(s);
        if (matcher.find() && matcher.start() < k) {
            System.out.println(matcher.group());
        } else {
            System.out.println(1);
        }
    } String s = scanner.next(); s scanner.next() scanner.next scanner long k = scanner.nextLong(); k scanner.nextLong() scanner.nextLong scanner Matcher matcher = Pattern.compile("[2-9]").matcher(s); matcher Pattern.compile("[2-9]").matcher(s) Pattern.compile("[2-9]").matcher Pattern.compile("[2-9]") Pattern.compile Pattern "[2-9]" s if (matcher.find() && matcher.start() < k) {
            System.out.println(matcher.group());
        } else {
            System.out.println(1);
        } matcher.find() && matcher.start() < k matcher.find() matcher.find matcher matcher.start() < k matcher.start() matcher.start matcher k {
            System.out.println(matcher.group());
        } System.out.println(matcher.group()) System.out.println System.out System System.out matcher.group() matcher.group matcher {
            System.out.println(1);
        } System.out.println(1) System.out.println System.out System System.out 1 String[] args args public class Main {
    private static java.util.Scanner scanner = new java.util.Scanner(System.in);

    public static void main(String[] args) {
        String s = scanner.next();
        long k = scanner.nextLong();
        Matcher matcher = Pattern.compile("[2-9]").matcher(s);
        if (matcher.find() && matcher.start() < k) {
            System.out.println(matcher.group());
        } else {
            System.out.println(1);
        }
    }
} public class Main {
    private static java.util.Scanner scanner = new java.util.Scanner(System.in);

    public static void main(String[] args) {
        String s = scanner.next();
        long k = scanner.nextLong();
        Matcher matcher = Pattern.compile("[2-9]").matcher(s);
        if (matcher.find() && matcher.start() < k) {
            System.out.println(matcher.group());
        } else {
            System.out.println(1);
        }
    }
} Main
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {
    private static java.util.Scanner scanner = new java.util.Scanner(System.in);

    public static void main(String[] args) {
        String s = scanner.next();
        long k = scanner.nextLong();
        Matcher matcher = Pattern.compile("[2-9]").matcher(s);
        if (matcher.find() && matcher.start() < k) {
            System.out.println(matcher.group());
        } else {
            System.out.println(1);
        }
    }
}