import java.util.Scanner;
public class Main {

    
    	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		String s=sc.nextLine();
		long K = sc.nextLong();
		double days  = 5*Math.pow(10, 15);
		long count=0;
		for(int i=0;i<s.length();i++) {
			
			int n = Integer.parseInt(s.charAt(i)+"");
			double m = Math.pow(n, days);
			count+=m;
			if (K<=count) 
			{System.out.println(n);
				break;}
		

		}
		

	}

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

    
    	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		String s=sc.nextLine();
		long K = sc.nextLong();
		double days  = 5*Math.pow(10, 15);
		long count=0;
		for(int i=0;i<s.length();i++) {
			
			int n = Integer.parseInt(s.charAt(i)+"");
			double m = Math.pow(n, days);
			count+=m;
			if (K<=count) 
			{System.out.println(n);
				break;}
		

		}
		

	}

} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		String s=sc.nextLine();
		long K = sc.nextLong();
		double days  = 5*Math.pow(10, 15);
		long count=0;
		for(int i=0;i<s.length();i++) {
			
			int n = Integer.parseInt(s.charAt(i)+"");
			double m = Math.pow(n, days);
			count+=m;
			if (K<=count) 
			{System.out.println(n);
				break;}
		

		}
		

	} main {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		String s=sc.nextLine();
		long K = sc.nextLong();
		double days  = 5*Math.pow(10, 15);
		long count=0;
		for(int i=0;i<s.length();i++) {
			
			int n = Integer.parseInt(s.charAt(i)+"");
			double m = Math.pow(n, days);
			count+=m;
			if (K<=count) 
			{System.out.println(n);
				break;}
		

		}
		

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s=sc.nextLine(); s sc.nextLine() sc.nextLine sc long K = sc.nextLong(); K sc.nextLong() sc.nextLong sc double days  = 5*Math.pow(10, 15); days 5*Math.pow(10, 15) 5 Math.pow(10, 15) Math.pow Math 10 15 long count=0; count 0 for(int i=0;i<s.length();i++) {
			
			int n = Integer.parseInt(s.charAt(i)+"");
			double m = Math.pow(n, days);
			count+=m;
			if (K<=count) 
			{System.out.println(n);
				break;}
		

		} 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.charAt(i)+"");
			double m = Math.pow(n, days);
			count+=m;
			if (K<=count) 
			{System.out.println(n);
				break;}
		

		} {
			
			int n = Integer.parseInt(s.charAt(i)+"");
			double m = Math.pow(n, days);
			count+=m;
			if (K<=count) 
			{System.out.println(n);
				break;}
		

		} int n = Integer.parseInt(s.charAt(i)+""); n Integer.parseInt(s.charAt(i)+"") Integer.parseInt Integer s.charAt(i)+"" s.charAt(i) s.charAt s i "" double m = Math.pow(n, days); m Math.pow(n, days) Math.pow Math n days count+=m count m if (K<=count) 
			{System.out.println(n);
				break;} K<=count K count {System.out.println(n);
				break;} System.out.println(n) System.out.println System.out System System.out n break; String[] args args public class Main {

    
    	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		String s=sc.nextLine();
		long K = sc.nextLong();
		double days  = 5*Math.pow(10, 15);
		long count=0;
		for(int i=0;i<s.length();i++) {
			
			int n = Integer.parseInt(s.charAt(i)+"");
			double m = Math.pow(n, days);
			count+=m;
			if (K<=count) 
			{System.out.println(n);
				break;}
		

		}
		

	}

} public class Main {

    
    	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		String s=sc.nextLine();
		long K = sc.nextLong();
		double days  = 5*Math.pow(10, 15);
		long count=0;
		for(int i=0;i<s.length();i++) {
			
			int n = Integer.parseInt(s.charAt(i)+"");
			double m = Math.pow(n, days);
			count+=m;
			if (K<=count) 
			{System.out.println(n);
				break;}
		

		}
		

	}

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

    
    	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		String s=sc.nextLine();
		long K = sc.nextLong();
		double days  = 5*Math.pow(10, 15);
		long count=0;
		for(int i=0;i<s.length();i++) {
			
			int n = Integer.parseInt(s.charAt(i)+"");
			double m = Math.pow(n, days);
			count+=m;
			if (K<=count) 
			{System.out.println(n);
				break;}
		

		}
		

	}

}
