import java.io.InputStream;
import java.util.Scanner;

public class Main {


	public static void main(String args[]) {
        InputStream inputStream = System.in;
        Scanner sc = new Scanner(inputStream);
        String out;
        String N=sc.next();
        long A = sc.nextLong();
        //int B = sc.nextInt();
        long count=A;
        int last=0;
        StringBuilder K=new StringBuilder();
        for(int i=0;i<N.length();i++) {
        	//System.out.println(N.charAt(i));
        	count-=Math.pow(Character.getNumericValue(N.charAt(i)), 500000000000000L);
        	if(count<=0) {
        		System.out.println(N.charAt(i));
        		break;}
        }
        //System.out.println(K);
        //System.out.println();
	}

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


	public static void main(String args[]) {
        InputStream inputStream = System.in;
        Scanner sc = new Scanner(inputStream);
        String out;
        String N=sc.next();
        long A = sc.nextLong();
        //int B = sc.nextInt();
        long count=A;
        int last=0;
        StringBuilder K=new StringBuilder();
        for(int i=0;i<N.length();i++) {
        	//System.out.println(N.charAt(i));
        	count-=Math.pow(Character.getNumericValue(N.charAt(i)), 500000000000000L);
        	if(count<=0) {
        		System.out.println(N.charAt(i));
        		break;}
        }
        //System.out.println(K);
        //System.out.println();
	}

} Main public static void main(String args[]) {
        InputStream inputStream = System.in;
        Scanner sc = new Scanner(inputStream);
        String out;
        String N=sc.next();
        long A = sc.nextLong();
        //int B = sc.nextInt();
        long count=A;
        int last=0;
        StringBuilder K=new StringBuilder();
        for(int i=0;i<N.length();i++) {
        	//System.out.println(N.charAt(i));
        	count-=Math.pow(Character.getNumericValue(N.charAt(i)), 500000000000000L);
        	if(count<=0) {
        		System.out.println(N.charAt(i));
        		break;}
        }
        //System.out.println(K);
        //System.out.println();
	} main {
        InputStream inputStream = System.in;
        Scanner sc = new Scanner(inputStream);
        String out;
        String N=sc.next();
        long A = sc.nextLong();
        //int B = sc.nextInt();
        long count=A;
        int last=0;
        StringBuilder K=new StringBuilder();
        for(int i=0;i<N.length();i++) {
        	//System.out.println(N.charAt(i));
        	count-=Math.pow(Character.getNumericValue(N.charAt(i)), 500000000000000L);
        	if(count<=0) {
        		System.out.println(N.charAt(i));
        		break;}
        }
        //System.out.println(K);
        //System.out.println();
	} InputStream inputStream = System.in; inputStream System.in System System.in Scanner sc = new Scanner(inputStream); sc new Scanner(inputStream) String out; out String N=sc.next(); N sc.next() sc.next sc long A = sc.nextLong(); A sc.nextLong() sc.nextLong sc long count=A; count A int last=0; last 0 StringBuilder K=new StringBuilder(); K new StringBuilder() for(int i=0;i<N.length();i++) {
        	//System.out.println(N.charAt(i));
        	count-=Math.pow(Character.getNumericValue(N.charAt(i)), 500000000000000L);
        	if(count<=0) {
        		System.out.println(N.charAt(i));
        		break;}
        } int i=0; int i=0; i 0 i<N.length() i N.length() N.length N i++ i++ i {
        	//System.out.println(N.charAt(i));
        	count-=Math.pow(Character.getNumericValue(N.charAt(i)), 500000000000000L);
        	if(count<=0) {
        		System.out.println(N.charAt(i));
        		break;}
        } {
        	//System.out.println(N.charAt(i));
        	count-=Math.pow(Character.getNumericValue(N.charAt(i)), 500000000000000L);
        	if(count<=0) {
        		System.out.println(N.charAt(i));
        		break;}
        } count-=Math.pow(Character.getNumericValue(N.charAt(i)), 500000000000000L) count Math.pow(Character.getNumericValue(N.charAt(i)), 500000000000000L) Math.pow Math Character.getNumericValue(N.charAt(i)) Character.getNumericValue Character N.charAt(i) N.charAt N i 500000000000000L if(count<=0) {
        		System.out.println(N.charAt(i));
        		break;} count<=0 count 0 {
        		System.out.println(N.charAt(i));
        		break;} System.out.println(N.charAt(i)) System.out.println System.out System System.out N.charAt(i) N.charAt N i break; String args[] args public class Main {


	public static void main(String args[]) {
        InputStream inputStream = System.in;
        Scanner sc = new Scanner(inputStream);
        String out;
        String N=sc.next();
        long A = sc.nextLong();
        //int B = sc.nextInt();
        long count=A;
        int last=0;
        StringBuilder K=new StringBuilder();
        for(int i=0;i<N.length();i++) {
        	//System.out.println(N.charAt(i));
        	count-=Math.pow(Character.getNumericValue(N.charAt(i)), 500000000000000L);
        	if(count<=0) {
        		System.out.println(N.charAt(i));
        		break;}
        }
        //System.out.println(K);
        //System.out.println();
	}

} public class Main {


	public static void main(String args[]) {
        InputStream inputStream = System.in;
        Scanner sc = new Scanner(inputStream);
        String out;
        String N=sc.next();
        long A = sc.nextLong();
        //int B = sc.nextInt();
        long count=A;
        int last=0;
        StringBuilder K=new StringBuilder();
        for(int i=0;i<N.length();i++) {
        	//System.out.println(N.charAt(i));
        	count-=Math.pow(Character.getNumericValue(N.charAt(i)), 500000000000000L);
        	if(count<=0) {
        		System.out.println(N.charAt(i));
        		break;}
        }
        //System.out.println(K);
        //System.out.println();
	}

} Main
import java.io.InputStream;
import java.util.Scanner;

public class Main {


	public static void main(String args[]) {
        InputStream inputStream = System.in;
        Scanner sc = new Scanner(inputStream);
        String out;
        String N=sc.next();
        long A = sc.nextLong();
        //int B = sc.nextInt();
        long count=A;
        int last=0;
        StringBuilder K=new StringBuilder();
        for(int i=0;i<N.length();i++) {
        	//System.out.println(N.charAt(i));
        	count-=Math.pow(Character.getNumericValue(N.charAt(i)), 500000000000000L);
        	if(count<=0) {
        		System.out.println(N.charAt(i));
        		break;}
        }
        //System.out.println(K);
        //System.out.println();
	}

}
