

import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String S = scanner.next();
		long K = scanner.nextLong();
		
		
		for(int i=0; i<S.length(); i++) {
			char c = S.charAt(i);
			K = (long) (K - Math.pow(Integer.parseInt(Character.toString(c)), 5*Math.pow(10, 15)));
			if(K <= 0) {
				System.out.println(c);
				break;
			}
			
		}
		

	}

} import java.util.*; util.* java public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String S = scanner.next();
		long K = scanner.nextLong();
		
		
		for(int i=0; i<S.length(); i++) {
			char c = S.charAt(i);
			K = (long) (K - Math.pow(Integer.parseInt(Character.toString(c)), 5*Math.pow(10, 15)));
			if(K <= 0) {
				System.out.println(c);
				break;
			}
			
		}
		

	}

} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String S = scanner.next();
		long K = scanner.nextLong();
		
		
		for(int i=0; i<S.length(); i++) {
			char c = S.charAt(i);
			K = (long) (K - Math.pow(Integer.parseInt(Character.toString(c)), 5*Math.pow(10, 15)));
			if(K <= 0) {
				System.out.println(c);
				break;
			}
			
		}
		

	} main {
		Scanner scanner = new Scanner(System.in);
		String S = scanner.next();
		long K = scanner.nextLong();
		
		
		for(int i=0; i<S.length(); i++) {
			char c = S.charAt(i);
			K = (long) (K - Math.pow(Integer.parseInt(Character.toString(c)), 5*Math.pow(10, 15)));
			if(K <= 0) {
				System.out.println(c);
				break;
			}
			
		}
		

	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String S = scanner.next(); S scanner.next() scanner.next scanner long K = scanner.nextLong(); K scanner.nextLong() scanner.nextLong scanner for(int i=0; i<S.length(); i++) {
			char c = S.charAt(i);
			K = (long) (K - Math.pow(Integer.parseInt(Character.toString(c)), 5*Math.pow(10, 15)));
			if(K <= 0) {
				System.out.println(c);
				break;
			}
			
		} 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);
			K = (long) (K - Math.pow(Integer.parseInt(Character.toString(c)), 5*Math.pow(10, 15)));
			if(K <= 0) {
				System.out.println(c);
				break;
			}
			
		} {
			char c = S.charAt(i);
			K = (long) (K - Math.pow(Integer.parseInt(Character.toString(c)), 5*Math.pow(10, 15)));
			if(K <= 0) {
				System.out.println(c);
				break;
			}
			
		} char c = S.charAt(i); c S.charAt(i) S.charAt S i K = (long) (K - Math.pow(Integer.parseInt(Character.toString(c)), 5*Math.pow(10, 15))) K (long) (K - Math.pow(Integer.parseInt(Character.toString(c)), 5*Math.pow(10, 15))) K Math.pow(Integer.parseInt(Character.toString(c)), 5*Math.pow(10, 15)) Math.pow Math Integer.parseInt(Character.toString(c)) Integer.parseInt Integer Character.toString(c) Character.toString Character c 5*Math.pow(10, 15) 5 Math.pow(10, 15) Math.pow Math 10 15 if(K <= 0) {
				System.out.println(c);
				break;
			} K <= 0 K 0 {
				System.out.println(c);
				break;
			} System.out.println(c) System.out.println System.out System System.out c break; String[] args args public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String S = scanner.next();
		long K = scanner.nextLong();
		
		
		for(int i=0; i<S.length(); i++) {
			char c = S.charAt(i);
			K = (long) (K - Math.pow(Integer.parseInt(Character.toString(c)), 5*Math.pow(10, 15)));
			if(K <= 0) {
				System.out.println(c);
				break;
			}
			
		}
		

	}

} public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String S = scanner.next();
		long K = scanner.nextLong();
		
		
		for(int i=0; i<S.length(); i++) {
			char c = S.charAt(i);
			K = (long) (K - Math.pow(Integer.parseInt(Character.toString(c)), 5*Math.pow(10, 15)));
			if(K <= 0) {
				System.out.println(c);
				break;
			}
			
		}
		

	}

} Main


import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String S = scanner.next();
		long K = scanner.nextLong();
		
		
		for(int i=0; i<S.length(); i++) {
			char c = S.charAt(i);
			K = (long) (K - Math.pow(Integer.parseInt(Character.toString(c)), 5*Math.pow(10, 15)));
			if(K <= 0) {
				System.out.println(c);
				break;
			}
			
		}
		

	}

}
