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();
		char ss[] = s.toCharArray();

		char answer= '1';

		for (int i=0;i<k && i<ss.length && answer == '1';++i){
			answer= ss[i];
		}

		System.out.println(answer);
	}

} 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();
		char ss[] = s.toCharArray();

		char answer= '1';

		for (int i=0;i<k && i<ss.length && answer == '1';++i){
			answer= ss[i];
		}

		System.out.println(answer);
	}

} Main public static void main(String args[]){

		Scanner sc = new Scanner(System.in);

		String s =sc.next();
		long k=sc.nextLong();
		char ss[] = s.toCharArray();

		char answer= '1';

		for (int i=0;i<k && i<ss.length && answer == '1';++i){
			answer= ss[i];
		}

		System.out.println(answer);
	} main {

		Scanner sc = new Scanner(System.in);

		String s =sc.next();
		long k=sc.nextLong();
		char ss[] = s.toCharArray();

		char answer= '1';

		for (int i=0;i<k && i<ss.length && answer == '1';++i){
			answer= ss[i];
		}

		System.out.println(answer);
	} 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 char ss[] = s.toCharArray(); ss s.toCharArray() s.toCharArray s char answer= '1'; answer '1' for (int i=0;i<k && i<ss.length && answer == '1';++i){
			answer= ss[i];
		} int i=0; int i=0; i 0 i<k && i<ss.length && answer == '1' i<k && i<ss.length && answer == '1' i<k i k i<ss.length i ss.length ss ss.length answer == '1' answer '1' ++i ++i i {
			answer= ss[i];
		} {
			answer= ss[i];
		} answer= ss[i] answer ss[i] ss i System.out.println(answer) System.out.println System.out System System.out answer 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();
		char ss[] = s.toCharArray();

		char answer= '1';

		for (int i=0;i<k && i<ss.length && answer == '1';++i){
			answer= ss[i];
		}

		System.out.println(answer);
	}

} public class Main{
	public static void main(String args[]){

		Scanner sc = new Scanner(System.in);

		String s =sc.next();
		long k=sc.nextLong();
		char ss[] = s.toCharArray();

		char answer= '1';

		for (int i=0;i<k && i<ss.length && answer == '1';++i){
			answer= ss[i];
		}

		System.out.println(answer);
	}

} 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();
		char ss[] = s.toCharArray();

		char answer= '1';

		for (int i=0;i<k && i<ss.length && answer == '1';++i){
			answer= ss[i];
		}

		System.out.println(answer);
	}

}