import java.util.Scanner;
 
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long k = sc.nextLong();
		long len = 0;
		char[] c = s.toCharArray();
		for(int i = 0; i < c.length; i++) {
			long temp = c[i]-'0';
			k -= (long) Math.pow(temp, 5*Math.pow(10, 15));
			if(k <=0) {
				System.out.println(temp);
				break;
			}
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long k = sc.nextLong();
		long len = 0;
		char[] c = s.toCharArray();
		for(int i = 0; i < c.length; i++) {
			long temp = c[i]-'0';
			k -= (long) Math.pow(temp, 5*Math.pow(10, 15));
			if(k <=0) {
				System.out.println(temp);
				break;
			}
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long k = sc.nextLong();
		long len = 0;
		char[] c = s.toCharArray();
		for(int i = 0; i < c.length; i++) {
			long temp = c[i]-'0';
			k -= (long) Math.pow(temp, 5*Math.pow(10, 15));
			if(k <=0) {
				System.out.println(temp);
				break;
			}
		}
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long k = sc.nextLong();
		long len = 0;
		char[] c = s.toCharArray();
		for(int i = 0; i < c.length; i++) {
			long temp = c[i]-'0';
			k -= (long) Math.pow(temp, 5*Math.pow(10, 15));
			if(k <=0) {
				System.out.println(temp);
				break;
			}
		}
	} 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 long len = 0; len 0 char[] c = s.toCharArray(); c s.toCharArray() s.toCharArray s for(int i = 0; i < c.length; i++) {
			long temp = c[i]-'0';
			k -= (long) Math.pow(temp, 5*Math.pow(10, 15));
			if(k <=0) {
				System.out.println(temp);
				break;
			}
		} int i = 0; int i = 0; i 0 i < c.length i c.length c c.length i++ i++ i {
			long temp = c[i]-'0';
			k -= (long) Math.pow(temp, 5*Math.pow(10, 15));
			if(k <=0) {
				System.out.println(temp);
				break;
			}
		} {
			long temp = c[i]-'0';
			k -= (long) Math.pow(temp, 5*Math.pow(10, 15));
			if(k <=0) {
				System.out.println(temp);
				break;
			}
		} long temp = c[i]-'0'; temp c[i]-'0' c[i] c i '0' k -= (long) Math.pow(temp, 5*Math.pow(10, 15)) k (long) Math.pow(temp, 5*Math.pow(10, 15)) Math.pow Math temp 5*Math.pow(10, 15) 5 Math.pow(10, 15) Math.pow Math 10 15 if(k <=0) {
				System.out.println(temp);
				break;
			} k <=0 k 0 {
				System.out.println(temp);
				break;
			} System.out.println(temp) System.out.println System.out System System.out temp break; 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();
		long len = 0;
		char[] c = s.toCharArray();
		for(int i = 0; i < c.length; i++) {
			long temp = c[i]-'0';
			k -= (long) Math.pow(temp, 5*Math.pow(10, 15));
			if(k <=0) {
				System.out.println(temp);
				break;
			}
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long k = sc.nextLong();
		long len = 0;
		char[] c = s.toCharArray();
		for(int i = 0; i < c.length; i++) {
			long temp = c[i]-'0';
			k -= (long) Math.pow(temp, 5*Math.pow(10, 15));
			if(k <=0) {
				System.out.println(temp);
				break;
			}
		}
	}
} Main
import java.util.Scanner;
 
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long k = sc.nextLong();
		long len = 0;
		char[] c = s.toCharArray();
		for(int i = 0; i < c.length; i++) {
			long temp = c[i]-'0';
			k -= (long) Math.pow(temp, 5*Math.pow(10, 15));
			if(k <=0) {
				System.out.println(temp);
				break;
			}
		}
	}
}