import java.util.*;
public class Main{
	public static final Scanner sc = new Scanner(System.in);
  	public static void main(String[] arg){
		String s = sc.next();
		long k = sc.nextLong();
        char c;
        char ans = '1';
        for (int i = 0; i<s.length(); i++){
        	c = s.charAt(i);
            if (ans != c){
            	ans = c;
                break;
            }
            k--;
            if (k==0){
            	break;
            }
        }
        System.out.println(ans);
    }
} import java.util.*; util.* java public class Main{
	public static final Scanner sc = new Scanner(System.in);
  	public static void main(String[] arg){
		String s = sc.next();
		long k = sc.nextLong();
        char c;
        char ans = '1';
        for (int i = 0; i<s.length(); i++){
        	c = s.charAt(i);
            if (ans != c){
            	ans = c;
                break;
            }
            k--;
            if (k==0){
            	break;
            }
        }
        System.out.println(ans);
    }
} Main public static final Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] arg){
		String s = sc.next();
		long k = sc.nextLong();
        char c;
        char ans = '1';
        for (int i = 0; i<s.length(); i++){
        	c = s.charAt(i);
            if (ans != c){
            	ans = c;
                break;
            }
            k--;
            if (k==0){
            	break;
            }
        }
        System.out.println(ans);
    } main {
		String s = sc.next();
		long k = sc.nextLong();
        char c;
        char ans = '1';
        for (int i = 0; i<s.length(); i++){
        	c = s.charAt(i);
            if (ans != c){
            	ans = c;
                break;
            }
            k--;
            if (k==0){
            	break;
            }
        }
        System.out.println(ans);
    } String s = sc.next(); s sc.next() sc.next sc long k = sc.nextLong(); k sc.nextLong() sc.nextLong sc char c; c char ans = '1'; ans '1' for (int i = 0; i<s.length(); i++){
        	c = s.charAt(i);
            if (ans != c){
            	ans = c;
                break;
            }
            k--;
            if (k==0){
            	break;
            }
        } int i = 0; int i = 0; i 0 i<s.length() i s.length() s.length s i++ i++ i {
        	c = s.charAt(i);
            if (ans != c){
            	ans = c;
                break;
            }
            k--;
            if (k==0){
            	break;
            }
        } {
        	c = s.charAt(i);
            if (ans != c){
            	ans = c;
                break;
            }
            k--;
            if (k==0){
            	break;
            }
        } c = s.charAt(i) c s.charAt(i) s.charAt s i if (ans != c){
            	ans = c;
                break;
            } ans != c ans c {
            	ans = c;
                break;
            } ans = c ans c break; k-- k if (k==0){
            	break;
            } k==0 k 0 {
            	break;
            } break; System.out.println(ans) System.out.println System.out System System.out ans String[] arg arg public class Main{
	public static final Scanner sc = new Scanner(System.in);
  	public static void main(String[] arg){
		String s = sc.next();
		long k = sc.nextLong();
        char c;
        char ans = '1';
        for (int i = 0; i<s.length(); i++){
        	c = s.charAt(i);
            if (ans != c){
            	ans = c;
                break;
            }
            k--;
            if (k==0){
            	break;
            }
        }
        System.out.println(ans);
    }
} public class Main{
	public static final Scanner sc = new Scanner(System.in);
  	public static void main(String[] arg){
		String s = sc.next();
		long k = sc.nextLong();
        char c;
        char ans = '1';
        for (int i = 0; i<s.length(); i++){
        	c = s.charAt(i);
            if (ans != c){
            	ans = c;
                break;
            }
            k--;
            if (k==0){
            	break;
            }
        }
        System.out.println(ans);
    }
} Main
import java.util.*;
public class Main{
	public static final Scanner sc = new Scanner(System.in);
  	public static void main(String[] arg){
		String s = sc.next();
		long k = sc.nextLong();
        char c;
        char ans = '1';
        for (int i = 0; i<s.length(); i++){
        	c = s.charAt(i);
            if (ans != c){
            	ans = c;
                break;
            }
            k--;
            if (k==0){
            	break;
            }
        }
        System.out.println(ans);
    }
}