
import java.util.*;

import static java.lang.System.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        long K = sc.nextLong();

        double days = 5.0 * Math.pow(10, 15);  //兆:10^12, 1000兆: 10^15

        char ans = S.charAt(0);
        for(int i = 0; i < S.length(); i++){
            K -= Math.pow(Character.getNumericValue(S.charAt(i)), days);
            if(K <= 0){
                ans = S.charAt(i);
                break;
            }
        }

        out.println(ans);
    }
} import java.util.*; util.* java import static java.lang.System.*; import static java.lang.System.*; import static java.lang.System.*; public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        long K = sc.nextLong();

        double days = 5.0 * Math.pow(10, 15);  //兆:10^12, 1000兆: 10^15

        char ans = S.charAt(0);
        for(int i = 0; i < S.length(); i++){
            K -= Math.pow(Character.getNumericValue(S.charAt(i)), days);
            if(K <= 0){
                ans = S.charAt(i);
                break;
            }
        }

        out.println(ans);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        long K = sc.nextLong();

        double days = 5.0 * Math.pow(10, 15);  //兆:10^12, 1000兆: 10^15

        char ans = S.charAt(0);
        for(int i = 0; i < S.length(); i++){
            K -= Math.pow(Character.getNumericValue(S.charAt(i)), days);
            if(K <= 0){
                ans = S.charAt(i);
                break;
            }
        }

        out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        long K = sc.nextLong();

        double days = 5.0 * Math.pow(10, 15);  //兆:10^12, 1000兆: 10^15

        char ans = S.charAt(0);
        for(int i = 0; i < S.length(); i++){
            K -= Math.pow(Character.getNumericValue(S.charAt(i)), days);
            if(K <= 0){
                ans = S.charAt(i);
                break;
            }
        }

        out.println(ans);
    } 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 double days = 5.0 * Math.pow(10, 15); days 5.0 * Math.pow(10, 15) 5.0 Math.pow(10, 15) Math.pow Math 10 15 char ans = S.charAt(0); ans S.charAt(0) S.charAt S 0 for(int i = 0; i < S.length(); i++){
            K -= Math.pow(Character.getNumericValue(S.charAt(i)), days);
            if(K <= 0){
                ans = S.charAt(i);
                break;
            }
        } int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
            K -= Math.pow(Character.getNumericValue(S.charAt(i)), days);
            if(K <= 0){
                ans = S.charAt(i);
                break;
            }
        } {
            K -= Math.pow(Character.getNumericValue(S.charAt(i)), days);
            if(K <= 0){
                ans = S.charAt(i);
                break;
            }
        } K -= Math.pow(Character.getNumericValue(S.charAt(i)), days) K Math.pow(Character.getNumericValue(S.charAt(i)), days) Math.pow Math Character.getNumericValue(S.charAt(i)) Character.getNumericValue Character S.charAt(i) S.charAt S i days if(K <= 0){
                ans = S.charAt(i);
                break;
            } K <= 0 K 0 {
                ans = S.charAt(i);
                break;
            } ans = S.charAt(i) ans S.charAt(i) S.charAt S i break; out.println(ans) out.println out ans 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();

        double days = 5.0 * Math.pow(10, 15);  //兆:10^12, 1000兆: 10^15

        char ans = S.charAt(0);
        for(int i = 0; i < S.length(); i++){
            K -= Math.pow(Character.getNumericValue(S.charAt(i)), days);
            if(K <= 0){
                ans = S.charAt(i);
                break;
            }
        }

        out.println(ans);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        long K = sc.nextLong();

        double days = 5.0 * Math.pow(10, 15);  //兆:10^12, 1000兆: 10^15

        char ans = S.charAt(0);
        for(int i = 0; i < S.length(); i++){
            K -= Math.pow(Character.getNumericValue(S.charAt(i)), days);
            if(K <= 0){
                ans = S.charAt(i);
                break;
            }
        }

        out.println(ans);
    }
} Main

import java.util.*;

import static java.lang.System.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        long K = sc.nextLong();

        double days = 5.0 * Math.pow(10, 15);  //兆:10^12, 1000兆: 10^15

        char ans = S.charAt(0);
        for(int i = 0; i < S.length(); i++){
            K -= Math.pow(Character.getNumericValue(S.charAt(i)), days);
            if(K <= 0){
                ans = S.charAt(i);
                break;
            }
        }

        out.println(ans);
    }
}
