import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
    	Scanner input = new Scanner(System.in);
      	String S = input.next();
      	long K = input.nextLong();
      	String ans = "";
      	double days = 5.0 * Math.pow(10, 15);
      	for (int i = 0; i < S.length(); i++) {
        	char c = S.charAt(i);
          	int n = Character.getNumericValue(c);
          	K -= (long)Math.pow(n, days);
          	if (K <= 0) {
              	System.out.println(c);
            	return;
            }
        }
    } 	
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
    	Scanner input = new Scanner(System.in);
      	String S = input.next();
      	long K = input.nextLong();
      	String ans = "";
      	double days = 5.0 * Math.pow(10, 15);
      	for (int i = 0; i < S.length(); i++) {
        	char c = S.charAt(i);
          	int n = Character.getNumericValue(c);
          	K -= (long)Math.pow(n, days);
          	if (K <= 0) {
              	System.out.println(c);
            	return;
            }
        }
    } 	
} Main public static void main(String[] args) {
    	Scanner input = new Scanner(System.in);
      	String S = input.next();
      	long K = input.nextLong();
      	String ans = "";
      	double days = 5.0 * Math.pow(10, 15);
      	for (int i = 0; i < S.length(); i++) {
        	char c = S.charAt(i);
          	int n = Character.getNumericValue(c);
          	K -= (long)Math.pow(n, days);
          	if (K <= 0) {
              	System.out.println(c);
            	return;
            }
        }
    } main {
    	Scanner input = new Scanner(System.in);
      	String S = input.next();
      	long K = input.nextLong();
      	String ans = "";
      	double days = 5.0 * Math.pow(10, 15);
      	for (int i = 0; i < S.length(); i++) {
        	char c = S.charAt(i);
          	int n = Character.getNumericValue(c);
          	K -= (long)Math.pow(n, days);
          	if (K <= 0) {
              	System.out.println(c);
            	return;
            }
        }
    } Scanner input = new Scanner(System.in); input new Scanner(System.in) String S = input.next(); S input.next() input.next input long K = input.nextLong(); K input.nextLong() input.nextLong input String ans = ""; ans "" 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 for (int i = 0; i < S.length(); i++) {
        	char c = S.charAt(i);
          	int n = Character.getNumericValue(c);
          	K -= (long)Math.pow(n, days);
          	if (K <= 0) {
              	System.out.println(c);
            	return;
            }
        } int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
        	char c = S.charAt(i);
          	int n = Character.getNumericValue(c);
          	K -= (long)Math.pow(n, days);
          	if (K <= 0) {
              	System.out.println(c);
            	return;
            }
        } {
        	char c = S.charAt(i);
          	int n = Character.getNumericValue(c);
          	K -= (long)Math.pow(n, days);
          	if (K <= 0) {
              	System.out.println(c);
            	return;
            }
        } char c = S.charAt(i); c S.charAt(i) S.charAt S i int n = Character.getNumericValue(c); n Character.getNumericValue(c) Character.getNumericValue Character c K -= (long)Math.pow(n, days) K (long)Math.pow(n, days) Math.pow Math n days if (K <= 0) {
              	System.out.println(c);
            	return;
            } K <= 0 K 0 {
              	System.out.println(c);
            	return;
            } System.out.println(c) System.out.println System.out System System.out c return; String[] args args public class Main {
	public static void main(String[] args) {
    	Scanner input = new Scanner(System.in);
      	String S = input.next();
      	long K = input.nextLong();
      	String ans = "";
      	double days = 5.0 * Math.pow(10, 15);
      	for (int i = 0; i < S.length(); i++) {
        	char c = S.charAt(i);
          	int n = Character.getNumericValue(c);
          	K -= (long)Math.pow(n, days);
          	if (K <= 0) {
              	System.out.println(c);
            	return;
            }
        }
    } 	
} public class Main {
	public static void main(String[] args) {
    	Scanner input = new Scanner(System.in);
      	String S = input.next();
      	long K = input.nextLong();
      	String ans = "";
      	double days = 5.0 * Math.pow(10, 15);
      	for (int i = 0; i < S.length(); i++) {
        	char c = S.charAt(i);
          	int n = Character.getNumericValue(c);
          	K -= (long)Math.pow(n, days);
          	if (K <= 0) {
              	System.out.println(c);
            	return;
            }
        }
    } 	
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
    	Scanner input = new Scanner(System.in);
      	String S = input.next();
      	long K = input.nextLong();
      	String ans = "";
      	double days = 5.0 * Math.pow(10, 15);
      	for (int i = 0; i < S.length(); i++) {
        	char c = S.charAt(i);
          	int n = Character.getNumericValue(c);
          	K -= (long)Math.pow(n, days);
          	if (K <= 0) {
              	System.out.println(c);
            	return;
            }
        }
    } 	
}
