import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] sArray = sc.next().split("");
		double k = sc.nextDouble();
		for(int i = 0;i < sArray.length;i++) {
			double number = Double.parseDouble(sArray[i]);
			double count = Math.pow(number,5.0 * Math.pow(10, 15) );
			k -= count;
			if(k <= 0) {
				System.out.println((int)number);
				return;
			}
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] sArray = sc.next().split("");
		double k = sc.nextDouble();
		for(int i = 0;i < sArray.length;i++) {
			double number = Double.parseDouble(sArray[i]);
			double count = Math.pow(number,5.0 * Math.pow(10, 15) );
			k -= count;
			if(k <= 0) {
				System.out.println((int)number);
				return;
			}
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] sArray = sc.next().split("");
		double k = sc.nextDouble();
		for(int i = 0;i < sArray.length;i++) {
			double number = Double.parseDouble(sArray[i]);
			double count = Math.pow(number,5.0 * Math.pow(10, 15) );
			k -= count;
			if(k <= 0) {
				System.out.println((int)number);
				return;
			}
		}
	} main {
		Scanner sc = new Scanner(System.in);
		String[] sArray = sc.next().split("");
		double k = sc.nextDouble();
		for(int i = 0;i < sArray.length;i++) {
			double number = Double.parseDouble(sArray[i]);
			double count = Math.pow(number,5.0 * Math.pow(10, 15) );
			k -= count;
			if(k <= 0) {
				System.out.println((int)number);
				return;
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String[] sArray = sc.next().split(""); sArray sc.next().split("") sc.next().split sc.next() sc.next sc "" double k = sc.nextDouble(); k sc.nextDouble() sc.nextDouble sc for(int i = 0;i < sArray.length;i++) {
			double number = Double.parseDouble(sArray[i]);
			double count = Math.pow(number,5.0 * Math.pow(10, 15) );
			k -= count;
			if(k <= 0) {
				System.out.println((int)number);
				return;
			}
		} int i = 0; int i = 0; i 0 i < sArray.length i sArray.length sArray sArray.length i++ i++ i {
			double number = Double.parseDouble(sArray[i]);
			double count = Math.pow(number,5.0 * Math.pow(10, 15) );
			k -= count;
			if(k <= 0) {
				System.out.println((int)number);
				return;
			}
		} {
			double number = Double.parseDouble(sArray[i]);
			double count = Math.pow(number,5.0 * Math.pow(10, 15) );
			k -= count;
			if(k <= 0) {
				System.out.println((int)number);
				return;
			}
		} double number = Double.parseDouble(sArray[i]); number Double.parseDouble(sArray[i]) Double.parseDouble Double sArray[i] sArray i double count = Math.pow(number,5.0 * Math.pow(10, 15) ); count Math.pow(number,5.0 * Math.pow(10, 15) ) Math.pow Math number 5.0 * Math.pow(10, 15) 5.0 Math.pow(10, 15) Math.pow Math 10 15 k -= count k count if(k <= 0) {
				System.out.println((int)number);
				return;
			} k <= 0 k 0 {
				System.out.println((int)number);
				return;
			} System.out.println((int)number) System.out.println System.out System System.out (int)number return; String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] sArray = sc.next().split("");
		double k = sc.nextDouble();
		for(int i = 0;i < sArray.length;i++) {
			double number = Double.parseDouble(sArray[i]);
			double count = Math.pow(number,5.0 * Math.pow(10, 15) );
			k -= count;
			if(k <= 0) {
				System.out.println((int)number);
				return;
			}
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] sArray = sc.next().split("");
		double k = sc.nextDouble();
		for(int i = 0;i < sArray.length;i++) {
			double number = Double.parseDouble(sArray[i]);
			double count = Math.pow(number,5.0 * Math.pow(10, 15) );
			k -= count;
			if(k <= 0) {
				System.out.println((int)number);
				return;
			}
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] sArray = sc.next().split("");
		double k = sc.nextDouble();
		for(int i = 0;i < sArray.length;i++) {
			double number = Double.parseDouble(sArray[i]);
			double count = Math.pow(number,5.0 * Math.pow(10, 15) );
			k -= count;
			if(k <= 0) {
				System.out.println((int)number);
				return;
			}
		}
	}
}