import java.util.Scanner;

public class Main {
	  
	public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
		   
			String s = scanner.next();
			long k = scanner.nextLong();
			int counter = 0;
			
			
			String[] array = new String[s.length()];
			for(int i = 0; i < s.length(); i++) 
			{
				array[i] = s.substring(i, i + 1);
			}
			
			for( int i = 0; i < s.length(); i++ ) 
			{
				if( array[i].equals("1") ) 
				{
					counter++;
				}
				else 
				{
					break;
				}
			}
			if( counter >= k) 
			{
				System.out.println(1);
			}
			else 
			{
				System.out.println(array[counter]);
			}
			
		    scanner.close(); }
		  } import java.util.Scanner; Scanner java.util public class Main {
	  
	public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
		   
			String s = scanner.next();
			long k = scanner.nextLong();
			int counter = 0;
			
			
			String[] array = new String[s.length()];
			for(int i = 0; i < s.length(); i++) 
			{
				array[i] = s.substring(i, i + 1);
			}
			
			for( int i = 0; i < s.length(); i++ ) 
			{
				if( array[i].equals("1") ) 
				{
					counter++;
				}
				else 
				{
					break;
				}
			}
			if( counter >= k) 
			{
				System.out.println(1);
			}
			else 
			{
				System.out.println(array[counter]);
			}
			
		    scanner.close(); }
		  } Main public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
		   
			String s = scanner.next();
			long k = scanner.nextLong();
			int counter = 0;
			
			
			String[] array = new String[s.length()];
			for(int i = 0; i < s.length(); i++) 
			{
				array[i] = s.substring(i, i + 1);
			}
			
			for( int i = 0; i < s.length(); i++ ) 
			{
				if( array[i].equals("1") ) 
				{
					counter++;
				}
				else 
				{
					break;
				}
			}
			if( counter >= k) 
			{
				System.out.println(1);
			}
			else 
			{
				System.out.println(array[counter]);
			}
			
		    scanner.close(); } main {
		    Scanner scanner = new Scanner(System.in);
		   
			String s = scanner.next();
			long k = scanner.nextLong();
			int counter = 0;
			
			
			String[] array = new String[s.length()];
			for(int i = 0; i < s.length(); i++) 
			{
				array[i] = s.substring(i, i + 1);
			}
			
			for( int i = 0; i < s.length(); i++ ) 
			{
				if( array[i].equals("1") ) 
				{
					counter++;
				}
				else 
				{
					break;
				}
			}
			if( counter >= k) 
			{
				System.out.println(1);
			}
			else 
			{
				System.out.println(array[counter]);
			}
			
		    scanner.close(); } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String s = scanner.next(); s scanner.next() scanner.next scanner long k = scanner.nextLong(); k scanner.nextLong() scanner.nextLong scanner int counter = 0; counter 0 String[] array = new String[s.length()]; array new String[s.length()] s.length() s.length s for(int i = 0; i < s.length(); i++) 
			{
				array[i] = s.substring(i, i + 1);
			} int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
				array[i] = s.substring(i, i + 1);
			} {
				array[i] = s.substring(i, i + 1);
			} array[i] = s.substring(i, i + 1) array[i] array i s.substring(i, i + 1) s.substring s i i + 1 i 1 for( int i = 0; i < s.length(); i++ ) 
			{
				if( array[i].equals("1") ) 
				{
					counter++;
				}
				else 
				{
					break;
				}
			} int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
				if( array[i].equals("1") ) 
				{
					counter++;
				}
				else 
				{
					break;
				}
			} {
				if( array[i].equals("1") ) 
				{
					counter++;
				}
				else 
				{
					break;
				}
			} if( array[i].equals("1") ) 
				{
					counter++;
				}
				else 
				{
					break;
				} array[i].equals("1") array[i].equals array[i] array i "1" {
					counter++;
				} counter++ counter {
					break;
				} break; if( counter >= k) 
			{
				System.out.println(1);
			}
			else 
			{
				System.out.println(array[counter]);
			} counter >= k counter k {
				System.out.println(1);
			} System.out.println(1) System.out.println System.out System System.out 1 {
				System.out.println(array[counter]);
			} System.out.println(array[counter]) System.out.println System.out System System.out array[counter] array counter scanner.close() scanner.close scanner String args[] args public class Main {
	  
	public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
		   
			String s = scanner.next();
			long k = scanner.nextLong();
			int counter = 0;
			
			
			String[] array = new String[s.length()];
			for(int i = 0; i < s.length(); i++) 
			{
				array[i] = s.substring(i, i + 1);
			}
			
			for( int i = 0; i < s.length(); i++ ) 
			{
				if( array[i].equals("1") ) 
				{
					counter++;
				}
				else 
				{
					break;
				}
			}
			if( counter >= k) 
			{
				System.out.println(1);
			}
			else 
			{
				System.out.println(array[counter]);
			}
			
		    scanner.close(); }
		  } public class Main {
	  
	public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
		   
			String s = scanner.next();
			long k = scanner.nextLong();
			int counter = 0;
			
			
			String[] array = new String[s.length()];
			for(int i = 0; i < s.length(); i++) 
			{
				array[i] = s.substring(i, i + 1);
			}
			
			for( int i = 0; i < s.length(); i++ ) 
			{
				if( array[i].equals("1") ) 
				{
					counter++;
				}
				else 
				{
					break;
				}
			}
			if( counter >= k) 
			{
				System.out.println(1);
			}
			else 
			{
				System.out.println(array[counter]);
			}
			
		    scanner.close(); }
		  } Main
import java.util.Scanner;

public class Main {
	  
	public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
		   
			String s = scanner.next();
			long k = scanner.nextLong();
			int counter = 0;
			
			
			String[] array = new String[s.length()];
			for(int i = 0; i < s.length(); i++) 
			{
				array[i] = s.substring(i, i + 1);
			}
			
			for( int i = 0; i < s.length(); i++ ) 
			{
				if( array[i].equals("1") ) 
				{
					counter++;
				}
				else 
				{
					break;
				}
			}
			if( counter >= k) 
			{
				System.out.println(1);
			}
			else 
			{
				System.out.println(array[counter]);
			}
			
		    scanner.close(); }
		  }