import java.util.Scanner;

public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			String S = scan.next();
			
			long K = scan.nextLong();
			
			int one_count = 0;
			boolean one = false;
			
			for(int i = 0;i<S.length();i++) {
				if(!S.substring(i,i+1).equals("1")) {
					break;}
				one_count++;
			}
			
			
			//System.out.println(one_count);
			
			
			if(one_count==0) {//一文字めが１ではなかった
				System.out.println(S.substring(0, 1));
			}else {//一文字目が１でone_countの値が一が続く個数
				if(one_count<K) {
					System.out.println(S.substring(one_count, one_count+1));
				}else{
					 System.out.println("1");
				}
			}
			
			
			/*if(S.substring(0, 1).equals("1")) {
				if(K==1) System.out.println("1");
				else System.out.println(S.substring(1, 2));
			}else{
				System.out.println(S.substring(0, 1));
			}*/
			
			
			
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			String S = scan.next();
			
			long K = scan.nextLong();
			
			int one_count = 0;
			boolean one = false;
			
			for(int i = 0;i<S.length();i++) {
				if(!S.substring(i,i+1).equals("1")) {
					break;}
				one_count++;
			}
			
			
			//System.out.println(one_count);
			
			
			if(one_count==0) {//一文字めが１ではなかった
				System.out.println(S.substring(0, 1));
			}else {//一文字目が１でone_countの値が一が続く個数
				if(one_count<K) {
					System.out.println(S.substring(one_count, one_count+1));
				}else{
					 System.out.println("1");
				}
			}
			
			
			/*if(S.substring(0, 1).equals("1")) {
				if(K==1) System.out.println("1");
				else System.out.println(S.substring(1, 2));
			}else{
				System.out.println(S.substring(0, 1));
			}*/
			
			
			
		}
	}
} Main public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			String S = scan.next();
			
			long K = scan.nextLong();
			
			int one_count = 0;
			boolean one = false;
			
			for(int i = 0;i<S.length();i++) {
				if(!S.substring(i,i+1).equals("1")) {
					break;}
				one_count++;
			}
			
			
			//System.out.println(one_count);
			
			
			if(one_count==0) {//一文字めが１ではなかった
				System.out.println(S.substring(0, 1));
			}else {//一文字目が１でone_countの値が一が続く個数
				if(one_count<K) {
					System.out.println(S.substring(one_count, one_count+1));
				}else{
					 System.out.println("1");
				}
			}
			
			
			/*if(S.substring(0, 1).equals("1")) {
				if(K==1) System.out.println("1");
				else System.out.println(S.substring(1, 2));
			}else{
				System.out.println(S.substring(0, 1));
			}*/
			
			
			
		}
	} main {
		try(Scanner scan = new Scanner(System.in)){
			
			String S = scan.next();
			
			long K = scan.nextLong();
			
			int one_count = 0;
			boolean one = false;
			
			for(int i = 0;i<S.length();i++) {
				if(!S.substring(i,i+1).equals("1")) {
					break;}
				one_count++;
			}
			
			
			//System.out.println(one_count);
			
			
			if(one_count==0) {//一文字めが１ではなかった
				System.out.println(S.substring(0, 1));
			}else {//一文字目が１でone_countの値が一が続く個数
				if(one_count<K) {
					System.out.println(S.substring(one_count, one_count+1));
				}else{
					 System.out.println("1");
				}
			}
			
			
			/*if(S.substring(0, 1).equals("1")) {
				if(K==1) System.out.println("1");
				else System.out.println(S.substring(1, 2));
			}else{
				System.out.println(S.substring(0, 1));
			}*/
			
			
			
		}
	} try(Scanner scan = new Scanner(System.in)){
			
			String S = scan.next();
			
			long K = scan.nextLong();
			
			int one_count = 0;
			boolean one = false;
			
			for(int i = 0;i<S.length();i++) {
				if(!S.substring(i,i+1).equals("1")) {
					break;}
				one_count++;
			}
			
			
			//System.out.println(one_count);
			
			
			if(one_count==0) {//一文字めが１ではなかった
				System.out.println(S.substring(0, 1));
			}else {//一文字目が１でone_countの値が一が続く個数
				if(one_count<K) {
					System.out.println(S.substring(one_count, one_count+1));
				}else{
					 System.out.println("1");
				}
			}
			
			
			/*if(S.substring(0, 1).equals("1")) {
				if(K==1) System.out.println("1");
				else System.out.println(S.substring(1, 2));
			}else{
				System.out.println(S.substring(0, 1));
			}*/
			
			
			
		} {
			
			String S = scan.next();
			
			long K = scan.nextLong();
			
			int one_count = 0;
			boolean one = false;
			
			for(int i = 0;i<S.length();i++) {
				if(!S.substring(i,i+1).equals("1")) {
					break;}
				one_count++;
			}
			
			
			//System.out.println(one_count);
			
			
			if(one_count==0) {//一文字めが１ではなかった
				System.out.println(S.substring(0, 1));
			}else {//一文字目が１でone_countの値が一が続く個数
				if(one_count<K) {
					System.out.println(S.substring(one_count, one_count+1));
				}else{
					 System.out.println("1");
				}
			}
			
			
			/*if(S.substring(0, 1).equals("1")) {
				if(K==1) System.out.println("1");
				else System.out.println(S.substring(1, 2));
			}else{
				System.out.println(S.substring(0, 1));
			}*/
			
			
			
		} Scanner scan = new Scanner(System.in) Scanner scan = new Scanner(System.in) new Scanner(System.in) String S = scan.next(); S scan.next() scan.next scan long K = scan.nextLong(); K scan.nextLong() scan.nextLong scan int one_count = 0; one_count 0 boolean one = false; one false for(int i = 0;i<S.length();i++) {
				if(!S.substring(i,i+1).equals("1")) {
					break;}
				one_count++;
			} int i = 0; int i = 0; i 0 i<S.length() i S.length() S.length S i++ i++ i {
				if(!S.substring(i,i+1).equals("1")) {
					break;}
				one_count++;
			} {
				if(!S.substring(i,i+1).equals("1")) {
					break;}
				one_count++;
			} if(!S.substring(i,i+1).equals("1")) {
					break;} !S.substring(i,i+1).equals("1") S.substring(i,i+1).equals("1") S.substring(i,i+1).equals S.substring(i,i+1) S.substring S i i+1 i 1 "1" {
					break;} break; one_count++ one_count if(one_count==0) {//一文字めが１ではなかった
				System.out.println(S.substring(0, 1));
			}else {//一文字目が１でone_countの値が一が続く個数
				if(one_count<K) {
					System.out.println(S.substring(one_count, one_count+1));
				}else{
					 System.out.println("1");
				}
			} one_count==0 one_count 0 {//一文字めが１ではなかった
				System.out.println(S.substring(0, 1));
			} System.out.println(S.substring(0, 1)) System.out.println System.out System System.out S.substring(0, 1) S.substring S 0 1 {//一文字目が１でone_countの値が一が続く個数
				if(one_count<K) {
					System.out.println(S.substring(one_count, one_count+1));
				}else{
					 System.out.println("1");
				}
			} if(one_count<K) {
					System.out.println(S.substring(one_count, one_count+1));
				}else{
					 System.out.println("1");
				} one_count<K one_count K {
					System.out.println(S.substring(one_count, one_count+1));
				} System.out.println(S.substring(one_count, one_count+1)) System.out.println System.out System System.out S.substring(one_count, one_count+1) S.substring S one_count one_count+1 one_count 1 {
					 System.out.println("1");
				} System.out.println("1") System.out.println System.out System System.out "1" String[]args args public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			String S = scan.next();
			
			long K = scan.nextLong();
			
			int one_count = 0;
			boolean one = false;
			
			for(int i = 0;i<S.length();i++) {
				if(!S.substring(i,i+1).equals("1")) {
					break;}
				one_count++;
			}
			
			
			//System.out.println(one_count);
			
			
			if(one_count==0) {//一文字めが１ではなかった
				System.out.println(S.substring(0, 1));
			}else {//一文字目が１でone_countの値が一が続く個数
				if(one_count<K) {
					System.out.println(S.substring(one_count, one_count+1));
				}else{
					 System.out.println("1");
				}
			}
			
			
			/*if(S.substring(0, 1).equals("1")) {
				if(K==1) System.out.println("1");
				else System.out.println(S.substring(1, 2));
			}else{
				System.out.println(S.substring(0, 1));
			}*/
			
			
			
		}
	}
} public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			String S = scan.next();
			
			long K = scan.nextLong();
			
			int one_count = 0;
			boolean one = false;
			
			for(int i = 0;i<S.length();i++) {
				if(!S.substring(i,i+1).equals("1")) {
					break;}
				one_count++;
			}
			
			
			//System.out.println(one_count);
			
			
			if(one_count==0) {//一文字めが１ではなかった
				System.out.println(S.substring(0, 1));
			}else {//一文字目が１でone_countの値が一が続く個数
				if(one_count<K) {
					System.out.println(S.substring(one_count, one_count+1));
				}else{
					 System.out.println("1");
				}
			}
			
			
			/*if(S.substring(0, 1).equals("1")) {
				if(K==1) System.out.println("1");
				else System.out.println(S.substring(1, 2));
			}else{
				System.out.println(S.substring(0, 1));
			}*/
			
			
			
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			String S = scan.next();
			
			long K = scan.nextLong();
			
			int one_count = 0;
			boolean one = false;
			
			for(int i = 0;i<S.length();i++) {
				if(!S.substring(i,i+1).equals("1")) {
					break;}
				one_count++;
			}
			
			
			//System.out.println(one_count);
			
			
			if(one_count==0) {//一文字めが１ではなかった
				System.out.println(S.substring(0, 1));
			}else {//一文字目が１でone_countの値が一が続く個数
				if(one_count<K) {
					System.out.println(S.substring(one_count, one_count+1));
				}else{
					 System.out.println("1");
				}
			}
			
			
			/*if(S.substring(0, 1).equals("1")) {
				if(K==1) System.out.println("1");
				else System.out.println(S.substring(1, 2));
			}else{
				System.out.println(S.substring(0, 1));
			}*/
			
			
			
		}
	}
}
