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();

		int Onecnt = 0;
		int Slen = S.length();
		for(int i = 0; i < Slen; i++) {
		String Onehantei = S.substring(i, i+1);
		if(Onehantei.equals("1")) {
			Onecnt ++;
		}else {
			break;
		}
		}
		String ans = "1";
		if(Onecnt < K) {
			ans = S.substring(Onecnt,Onecnt+1);
		}

		System.out.println(ans);
		sc.close();

	}

} 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();

		int Onecnt = 0;
		int Slen = S.length();
		for(int i = 0; i < Slen; i++) {
		String Onehantei = S.substring(i, i+1);
		if(Onehantei.equals("1")) {
			Onecnt ++;
		}else {
			break;
		}
		}
		String ans = "1";
		if(Onecnt < K) {
			ans = S.substring(Onecnt,Onecnt+1);
		}

		System.out.println(ans);
		sc.close();

	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		long K = sc.nextLong();

		int Onecnt = 0;
		int Slen = S.length();
		for(int i = 0; i < Slen; i++) {
		String Onehantei = S.substring(i, i+1);
		if(Onehantei.equals("1")) {
			Onecnt ++;
		}else {
			break;
		}
		}
		String ans = "1";
		if(Onecnt < K) {
			ans = S.substring(Onecnt,Onecnt+1);
		}

		System.out.println(ans);
		sc.close();

	} main {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		long K = sc.nextLong();

		int Onecnt = 0;
		int Slen = S.length();
		for(int i = 0; i < Slen; i++) {
		String Onehantei = S.substring(i, i+1);
		if(Onehantei.equals("1")) {
			Onecnt ++;
		}else {
			break;
		}
		}
		String ans = "1";
		if(Onecnt < K) {
			ans = S.substring(Onecnt,Onecnt+1);
		}

		System.out.println(ans);
		sc.close();

	} 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 int Onecnt = 0; Onecnt 0 int Slen = S.length(); Slen S.length() S.length S for(int i = 0; i < Slen; i++) {
		String Onehantei = S.substring(i, i+1);
		if(Onehantei.equals("1")) {
			Onecnt ++;
		}else {
			break;
		}
		} int i = 0; int i = 0; i 0 i < Slen i Slen i++ i++ i {
		String Onehantei = S.substring(i, i+1);
		if(Onehantei.equals("1")) {
			Onecnt ++;
		}else {
			break;
		}
		} {
		String Onehantei = S.substring(i, i+1);
		if(Onehantei.equals("1")) {
			Onecnt ++;
		}else {
			break;
		}
		} String Onehantei = S.substring(i, i+1); Onehantei S.substring(i, i+1) S.substring S i i+1 i 1 if(Onehantei.equals("1")) {
			Onecnt ++;
		}else {
			break;
		} Onehantei.equals("1") Onehantei.equals Onehantei "1" {
			Onecnt ++;
		} Onecnt ++ Onecnt {
			break;
		} break; String ans = "1"; ans "1" if(Onecnt < K) {
			ans = S.substring(Onecnt,Onecnt+1);
		} Onecnt < K Onecnt K {
			ans = S.substring(Onecnt,Onecnt+1);
		} ans = S.substring(Onecnt,Onecnt+1) ans S.substring(Onecnt,Onecnt+1) S.substring S Onecnt Onecnt+1 Onecnt 1 System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc 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();

		int Onecnt = 0;
		int Slen = S.length();
		for(int i = 0; i < Slen; i++) {
		String Onehantei = S.substring(i, i+1);
		if(Onehantei.equals("1")) {
			Onecnt ++;
		}else {
			break;
		}
		}
		String ans = "1";
		if(Onecnt < K) {
			ans = S.substring(Onecnt,Onecnt+1);
		}

		System.out.println(ans);
		sc.close();

	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		long K = sc.nextLong();

		int Onecnt = 0;
		int Slen = S.length();
		for(int i = 0; i < Slen; i++) {
		String Onehantei = S.substring(i, i+1);
		if(Onehantei.equals("1")) {
			Onecnt ++;
		}else {
			break;
		}
		}
		String ans = "1";
		if(Onecnt < K) {
			ans = S.substring(Onecnt,Onecnt+1);
		}

		System.out.println(ans);
		sc.close();

	}

} 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();

		int Onecnt = 0;
		int Slen = S.length();
		for(int i = 0; i < Slen; i++) {
		String Onehantei = S.substring(i, i+1);
		if(Onehantei.equals("1")) {
			Onecnt ++;
		}else {
			break;
		}
		}
		String ans = "1";
		if(Onecnt < K) {
			ans = S.substring(Onecnt,Onecnt+1);
		}

		System.out.println(ans);
		sc.close();

	}

}
