import java.util.Scanner;
public class q27866 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String[] S = sc.nextLine().split("");
int i = sc.nextInt();
System.out.print(S[i-1]);
}
}