import java.util.Scanner;

public class Main{
public static void main(String[] args){
  Scanner sc = new Scanner(System.in);
String str  = sc.next();
long K = sc.nextLong();
boolean ended = false;
//int count=0;

for(int i=0;i<K;i++){
  char value = str.charAt(i);
  if(value != '1'){
    System.out.println(value);
    ended=true;
    break;
  }
}

if(!ended){
  System.out.println('1');
}

}
} import java.util.Scanner; Scanner java.util public class Main{
public static void main(String[] args){
  Scanner sc = new Scanner(System.in);
String str  = sc.next();
long K = sc.nextLong();
boolean ended = false;
//int count=0;

for(int i=0;i<K;i++){
  char value = str.charAt(i);
  if(value != '1'){
    System.out.println(value);
    ended=true;
    break;
  }
}

if(!ended){
  System.out.println('1');
}

}
} Main public static void main(String[] args){
  Scanner sc = new Scanner(System.in);
String str  = sc.next();
long K = sc.nextLong();
boolean ended = false;
//int count=0;

for(int i=0;i<K;i++){
  char value = str.charAt(i);
  if(value != '1'){
    System.out.println(value);
    ended=true;
    break;
  }
}

if(!ended){
  System.out.println('1');
}

} main {
  Scanner sc = new Scanner(System.in);
String str  = sc.next();
long K = sc.nextLong();
boolean ended = false;
//int count=0;

for(int i=0;i<K;i++){
  char value = str.charAt(i);
  if(value != '1'){
    System.out.println(value);
    ended=true;
    break;
  }
}

if(!ended){
  System.out.println('1');
}

} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String str  = sc.next(); str sc.next() sc.next sc long K = sc.nextLong(); K sc.nextLong() sc.nextLong sc boolean ended = false; ended false for(int i=0;i<K;i++){
  char value = str.charAt(i);
  if(value != '1'){
    System.out.println(value);
    ended=true;
    break;
  }
} int i=0; int i=0; i 0 i<K i K i++ i++ i {
  char value = str.charAt(i);
  if(value != '1'){
    System.out.println(value);
    ended=true;
    break;
  }
} {
  char value = str.charAt(i);
  if(value != '1'){
    System.out.println(value);
    ended=true;
    break;
  }
} char value = str.charAt(i); value str.charAt(i) str.charAt str i if(value != '1'){
    System.out.println(value);
    ended=true;
    break;
  } value != '1' value '1' {
    System.out.println(value);
    ended=true;
    break;
  } System.out.println(value) System.out.println System.out System System.out value ended=true ended true break; if(!ended){
  System.out.println('1');
} !ended ended {
  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){
  Scanner sc = new Scanner(System.in);
String str  = sc.next();
long K = sc.nextLong();
boolean ended = false;
//int count=0;

for(int i=0;i<K;i++){
  char value = str.charAt(i);
  if(value != '1'){
    System.out.println(value);
    ended=true;
    break;
  }
}

if(!ended){
  System.out.println('1');
}

}
} public class Main{
public static void main(String[] args){
  Scanner sc = new Scanner(System.in);
String str  = sc.next();
long K = sc.nextLong();
boolean ended = false;
//int count=0;

for(int i=0;i<K;i++){
  char value = str.charAt(i);
  if(value != '1'){
    System.out.println(value);
    ended=true;
    break;
  }
}

if(!ended){
  System.out.println('1');
}

}
} Main
import java.util.Scanner;

public class Main{
public static void main(String[] args){
  Scanner sc = new Scanner(System.in);
String str  = sc.next();
long K = sc.nextLong();
boolean ended = false;
//int count=0;

for(int i=0;i<K;i++){
  char value = str.charAt(i);
  if(value != '1'){
    System.out.println(value);
    ended=true;
    break;
  }
}

if(!ended){
  System.out.println('1');
}

}
}
