import java.util.Scanner;

public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      String S = in.next();
      long K = in.nextLong();
      char sol = '1';

      for (int i = 0; i < S.length(); ++i) {
        if (S.charAt(i) != '1') {
          if (K - 1 >= i) {
            sol = S.charAt(i);
            break;
          }          
        }
      }

      System.out.println(sol);
    }
  }
} import java.util.Scanner; Scanner java.util public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      String S = in.next();
      long K = in.nextLong();
      char sol = '1';

      for (int i = 0; i < S.length(); ++i) {
        if (S.charAt(i) != '1') {
          if (K - 1 >= i) {
            sol = S.charAt(i);
            break;
          }          
        }
      }

      System.out.println(sol);
    }
  }
} Main public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      String S = in.next();
      long K = in.nextLong();
      char sol = '1';

      for (int i = 0; i < S.length(); ++i) {
        if (S.charAt(i) != '1') {
          if (K - 1 >= i) {
            sol = S.charAt(i);
            break;
          }          
        }
      }

      System.out.println(sol);
    }
  } main {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      String S = in.next();
      long K = in.nextLong();
      char sol = '1';

      for (int i = 0; i < S.length(); ++i) {
        if (S.charAt(i) != '1') {
          if (K - 1 >= i) {
            sol = S.charAt(i);
            break;
          }          
        }
      }

      System.out.println(sol);
    }
  } Scanner in = new Scanner(System.in); in new Scanner(System.in) while (in.hasNext()) {
      String S = in.next();
      long K = in.nextLong();
      char sol = '1';

      for (int i = 0; i < S.length(); ++i) {
        if (S.charAt(i) != '1') {
          if (K - 1 >= i) {
            sol = S.charAt(i);
            break;
          }          
        }
      }

      System.out.println(sol);
    } in.hasNext() in.hasNext in {
      String S = in.next();
      long K = in.nextLong();
      char sol = '1';

      for (int i = 0; i < S.length(); ++i) {
        if (S.charAt(i) != '1') {
          if (K - 1 >= i) {
            sol = S.charAt(i);
            break;
          }          
        }
      }

      System.out.println(sol);
    } String S = in.next(); S in.next() in.next in long K = in.nextLong(); K in.nextLong() in.nextLong in char sol = '1'; sol '1' for (int i = 0; i < S.length(); ++i) {
        if (S.charAt(i) != '1') {
          if (K - 1 >= i) {
            sol = S.charAt(i);
            break;
          }          
        }
      } int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S ++i ++i i {
        if (S.charAt(i) != '1') {
          if (K - 1 >= i) {
            sol = S.charAt(i);
            break;
          }          
        }
      } {
        if (S.charAt(i) != '1') {
          if (K - 1 >= i) {
            sol = S.charAt(i);
            break;
          }          
        }
      } if (S.charAt(i) != '1') {
          if (K - 1 >= i) {
            sol = S.charAt(i);
            break;
          }          
        } S.charAt(i) != '1' S.charAt(i) S.charAt S i '1' {
          if (K - 1 >= i) {
            sol = S.charAt(i);
            break;
          }          
        } if (K - 1 >= i) {
            sol = S.charAt(i);
            break;
          } K - 1 >= i K - 1 K 1 i {
            sol = S.charAt(i);
            break;
          } sol = S.charAt(i) sol S.charAt(i) S.charAt S i break; System.out.println(sol) System.out.println System.out System System.out sol String[] args args public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      String S = in.next();
      long K = in.nextLong();
      char sol = '1';

      for (int i = 0; i < S.length(); ++i) {
        if (S.charAt(i) != '1') {
          if (K - 1 >= i) {
            sol = S.charAt(i);
            break;
          }          
        }
      }

      System.out.println(sol);
    }
  }
} public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      String S = in.next();
      long K = in.nextLong();
      char sol = '1';

      for (int i = 0; i < S.length(); ++i) {
        if (S.charAt(i) != '1') {
          if (K - 1 >= i) {
            sol = S.charAt(i);
            break;
          }          
        }
      }

      System.out.println(sol);
    }
  }
} Main
import java.util.Scanner;

public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      String S = in.next();
      long K = in.nextLong();
      char sol = '1';

      for (int i = 0; i < S.length(); ++i) {
        if (S.charAt(i) != '1') {
          if (K - 1 >= i) {
            sol = S.charAt(i);
            break;
          }          
        }
      }

      System.out.println(sol);
    }
  }
}