import java.util.Scanner;

public class Main {
	static int[] subTreeSize;
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		final long D = (long) (5 * Math.pow(10, 15));
		String s = sc.next();
		long k = sc.nextLong();
		long sum = 0;
		
		for (int i = 0; i < s.length(); i++) {
			int n = Integer.parseInt(s.substring(i, i + 1));
			sum += Math.pow(n, D);
			if (k <= sum) {
				System.out.println(n);
				sc.close();
				return;
			}
		}
		
		sc.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	static int[] subTreeSize;
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		final long D = (long) (5 * Math.pow(10, 15));
		String s = sc.next();
		long k = sc.nextLong();
		long sum = 0;
		
		for (int i = 0; i < s.length(); i++) {
			int n = Integer.parseInt(s.substring(i, i + 1));
			sum += Math.pow(n, D);
			if (k <= sum) {
				System.out.println(n);
				sc.close();
				return;
			}
		}
		
		sc.close();
	}
} Main static int[] subTreeSize; subTreeSize public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		final long D = (long) (5 * Math.pow(10, 15));
		String s = sc.next();
		long k = sc.nextLong();
		long sum = 0;
		
		for (int i = 0; i < s.length(); i++) {
			int n = Integer.parseInt(s.substring(i, i + 1));
			sum += Math.pow(n, D);
			if (k <= sum) {
				System.out.println(n);
				sc.close();
				return;
			}
		}
		
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		final long D = (long) (5 * Math.pow(10, 15));
		String s = sc.next();
		long k = sc.nextLong();
		long sum = 0;
		
		for (int i = 0; i < s.length(); i++) {
			int n = Integer.parseInt(s.substring(i, i + 1));
			sum += Math.pow(n, D);
			if (k <= sum) {
				System.out.println(n);
				sc.close();
				return;
			}
		}
		
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final long D = (long) (5 * Math.pow(10, 15)); D (long) (5 * Math.pow(10, 15)) 5 Math.pow(10, 15) Math.pow Math 10 15 String s = sc.next(); s sc.next() sc.next sc long k = sc.nextLong(); k sc.nextLong() sc.nextLong sc long sum = 0; sum 0 for (int i = 0; i < s.length(); i++) {
			int n = Integer.parseInt(s.substring(i, i + 1));
			sum += Math.pow(n, D);
			if (k <= sum) {
				System.out.println(n);
				sc.close();
				return;
			}
		} int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
			int n = Integer.parseInt(s.substring(i, i + 1));
			sum += Math.pow(n, D);
			if (k <= sum) {
				System.out.println(n);
				sc.close();
				return;
			}
		} {
			int n = Integer.parseInt(s.substring(i, i + 1));
			sum += Math.pow(n, D);
			if (k <= sum) {
				System.out.println(n);
				sc.close();
				return;
			}
		} int n = Integer.parseInt(s.substring(i, i + 1)); n Integer.parseInt(s.substring(i, i + 1)) Integer.parseInt Integer s.substring(i, i + 1) s.substring s i i + 1 i 1 sum += Math.pow(n, D) sum Math.pow(n, D) Math.pow Math n D if (k <= sum) {
				System.out.println(n);
				sc.close();
				return;
			} k <= sum k sum {
				System.out.println(n);
				sc.close();
				return;
			} System.out.println(n) System.out.println System.out System System.out n sc.close() sc.close sc return; sc.close() sc.close sc String[] args args public class Main {
	static int[] subTreeSize;
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		final long D = (long) (5 * Math.pow(10, 15));
		String s = sc.next();
		long k = sc.nextLong();
		long sum = 0;
		
		for (int i = 0; i < s.length(); i++) {
			int n = Integer.parseInt(s.substring(i, i + 1));
			sum += Math.pow(n, D);
			if (k <= sum) {
				System.out.println(n);
				sc.close();
				return;
			}
		}
		
		sc.close();
	}
} public class Main {
	static int[] subTreeSize;
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		final long D = (long) (5 * Math.pow(10, 15));
		String s = sc.next();
		long k = sc.nextLong();
		long sum = 0;
		
		for (int i = 0; i < s.length(); i++) {
			int n = Integer.parseInt(s.substring(i, i + 1));
			sum += Math.pow(n, D);
			if (k <= sum) {
				System.out.println(n);
				sc.close();
				return;
			}
		}
		
		sc.close();
	}
} Main
import java.util.Scanner;

public class Main {
	static int[] subTreeSize;
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		final long D = (long) (5 * Math.pow(10, 15));
		String s = sc.next();
		long k = sc.nextLong();
		long sum = 0;
		
		for (int i = 0; i < s.length(); i++) {
			int n = Integer.parseInt(s.substring(i, i + 1));
			sum += Math.pow(n, D);
			if (k <= sum) {
				System.out.println(n);
				sc.close();
				return;
			}
		}
		
		sc.close();
	}
}
