class Main {
  public static void main(String[] args) {
    java.util.Scanner sc = new java.util.Scanner(System.in);
    String S = sc.next();
    long K = sc.nextLong();
    for (int i = 0; i < S.length(); i++) {
      switch (S.charAt(i)) {
        case '1':
          K -= 1;
          if (K > 0) continue;
          println('1');
          return;
        
        default:
          println(S.charAt(i));
          return;
      }
    }
  }

  /* 以下、標準出力用関数 */
  static public void print(byte what) { System.out.print(what); System.out.flush(); }
  static public void print(boolean what) { System.out.print(what); System.out.flush(); }
  static public void print(char what) { System.out.print(what); System.out.flush(); }
  static public void print(int what) { System.out.print(what); System.out.flush(); }
  static public void print(long what) { System.out.print(what); System.out.flush(); }
  static public void print(float what) { System.out.print(what); System.out.flush(); }
  static public void print(double what) { System.out.print(what); System.out.flush(); }
  static public void print(String what) { System.out.print(what); System.out.flush(); }
  static public void print(Object... variables) { StringBuilder sb = new StringBuilder(); for (Object o : variables) { if (sb.length() != 0) { sb.append(" "); } if (o == null) { sb.append("null"); } else { sb.append(o.toString()); } } System.out.print(sb.toString()); }
  static public void println() { System.out.println(); }
  static public void println(byte what) { System.out.println(what); System.out.flush(); }
  static public void println(boolean what) { System.out.println(what); System.out.flush(); }
  static public void println(char what) { System.out.println(what); System.out.flush(); }
  static public void println(int what) { System.out.println(what); System.out.flush(); }
  static public void println(long what) { System.out.println(what); System.out.flush(); }
  static public void println(float what) { System.out.println(what); System.out.flush(); }
  static public void println(double what) { System.out.println(what); System.out.flush(); }
  static public void println(String what) { System.out.println(what); System.out.flush(); }
  static public void println(Object... variables) { print(variables); println(); }
  static public void println(Object what) { if (what == null) { System.out.println("null"); } else if (what.getClass().isArray()) { printArray(what); } else { System.out.println(what.toString()); System.out.flush(); } }
  static public void printArray(Object what) { if (what == null) { System.out.println("null"); } else { String name = what.getClass().getName(); if (name.charAt(0) == '[') { switch (name.charAt(1)) { case '[': System.out.println(what); break; case 'L': Object poo[] = (Object[]) what; for (int i = 0; i < poo.length; i++) { if (poo[i] instanceof String) { System.out.println("[" + i + "] \"" + poo[i] + "\""); } else { System.out.println("[" + i + "] " + poo[i]); } } break; case 'Z': boolean zz[] = (boolean[]) what; for (int i = 0; i < zz.length; i++) { System.out.println("[" + i + "] " + zz[i]); } break; case 'B': byte bb[] = (byte[]) what; for (int i = 0; i < bb.length; i++) { System.out.println("[" + i + "] " + bb[i]); } break; case 'C': char cc[] = (char[]) what; for (int i = 0; i < cc.length; i++) { System.out.println("[" + i + "] '" + cc[i] + "'"); } break; case 'I': int ii[] = (int[]) what; for (int i = 0; i < ii.length; i++) { System.out.println("[" + i + "] " + ii[i]); } break; case 'J': long jj[] = (long[]) what; for (int i = 0; i < jj.length; i++) { System.out.println("[" + i + "] " + jj[i]); } break; case 'F': float ff[] = (float[]) what; for (int i = 0; i < ff.length; i++) { System.out.println("[" + i + "] " + ff[i]); } break; case 'D': double dd[] = (double[]) what; for (int i = 0; i < dd.length; i++) { System.out.println("[" + i + "] " + dd[i]); } break; default: System.out.println(what); } } else { System.out.println(what); } } System.out.flush(); }
} class Main {
  public static void main(String[] args) {
    java.util.Scanner sc = new java.util.Scanner(System.in);
    String S = sc.next();
    long K = sc.nextLong();
    for (int i = 0; i < S.length(); i++) {
      switch (S.charAt(i)) {
        case '1':
          K -= 1;
          if (K > 0) continue;
          println('1');
          return;
        
        default:
          println(S.charAt(i));
          return;
      }
    }
  }

  /* 以下、標準出力用関数 */
  static public void print(byte what) { System.out.print(what); System.out.flush(); }
  static public void print(boolean what) { System.out.print(what); System.out.flush(); }
  static public void print(char what) { System.out.print(what); System.out.flush(); }
  static public void print(int what) { System.out.print(what); System.out.flush(); }
  static public void print(long what) { System.out.print(what); System.out.flush(); }
  static public void print(float what) { System.out.print(what); System.out.flush(); }
  static public void print(double what) { System.out.print(what); System.out.flush(); }
  static public void print(String what) { System.out.print(what); System.out.flush(); }
  static public void print(Object... variables) { StringBuilder sb = new StringBuilder(); for (Object o : variables) { if (sb.length() != 0) { sb.append(" "); } if (o == null) { sb.append("null"); } else { sb.append(o.toString()); } } System.out.print(sb.toString()); }
  static public void println() { System.out.println(); }
  static public void println(byte what) { System.out.println(what); System.out.flush(); }
  static public void println(boolean what) { System.out.println(what); System.out.flush(); }
  static public void println(char what) { System.out.println(what); System.out.flush(); }
  static public void println(int what) { System.out.println(what); System.out.flush(); }
  static public void println(long what) { System.out.println(what); System.out.flush(); }
  static public void println(float what) { System.out.println(what); System.out.flush(); }
  static public void println(double what) { System.out.println(what); System.out.flush(); }
  static public void println(String what) { System.out.println(what); System.out.flush(); }
  static public void println(Object... variables) { print(variables); println(); }
  static public void println(Object what) { if (what == null) { System.out.println("null"); } else if (what.getClass().isArray()) { printArray(what); } else { System.out.println(what.toString()); System.out.flush(); } }
  static public void printArray(Object what) { if (what == null) { System.out.println("null"); } else { String name = what.getClass().getName(); if (name.charAt(0) == '[') { switch (name.charAt(1)) { case '[': System.out.println(what); break; case 'L': Object poo[] = (Object[]) what; for (int i = 0; i < poo.length; i++) { if (poo[i] instanceof String) { System.out.println("[" + i + "] \"" + poo[i] + "\""); } else { System.out.println("[" + i + "] " + poo[i]); } } break; case 'Z': boolean zz[] = (boolean[]) what; for (int i = 0; i < zz.length; i++) { System.out.println("[" + i + "] " + zz[i]); } break; case 'B': byte bb[] = (byte[]) what; for (int i = 0; i < bb.length; i++) { System.out.println("[" + i + "] " + bb[i]); } break; case 'C': char cc[] = (char[]) what; for (int i = 0; i < cc.length; i++) { System.out.println("[" + i + "] '" + cc[i] + "'"); } break; case 'I': int ii[] = (int[]) what; for (int i = 0; i < ii.length; i++) { System.out.println("[" + i + "] " + ii[i]); } break; case 'J': long jj[] = (long[]) what; for (int i = 0; i < jj.length; i++) { System.out.println("[" + i + "] " + jj[i]); } break; case 'F': float ff[] = (float[]) what; for (int i = 0; i < ff.length; i++) { System.out.println("[" + i + "] " + ff[i]); } break; case 'D': double dd[] = (double[]) what; for (int i = 0; i < dd.length; i++) { System.out.println("[" + i + "] " + dd[i]); } break; default: System.out.println(what); } } else { System.out.println(what); } } System.out.flush(); }
} Main public static void main(String[] args) {
    java.util.Scanner sc = new java.util.Scanner(System.in);
    String S = sc.next();
    long K = sc.nextLong();
    for (int i = 0; i < S.length(); i++) {
      switch (S.charAt(i)) {
        case '1':
          K -= 1;
          if (K > 0) continue;
          println('1');
          return;
        
        default:
          println(S.charAt(i));
          return;
      }
    }
  } main {
    java.util.Scanner sc = new java.util.Scanner(System.in);
    String S = sc.next();
    long K = sc.nextLong();
    for (int i = 0; i < S.length(); i++) {
      switch (S.charAt(i)) {
        case '1':
          K -= 1;
          if (K > 0) continue;
          println('1');
          return;
        
        default:
          println(S.charAt(i));
          return;
      }
    }
  } java.util.Scanner sc = new java.util.Scanner(System.in); sc new java.util.Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc long K = sc.nextLong(); K sc.nextLong() sc.nextLong sc for (int i = 0; i < S.length(); i++) {
      switch (S.charAt(i)) {
        case '1':
          K -= 1;
          if (K > 0) continue;
          println('1');
          return;
        
        default:
          println(S.charAt(i));
          return;
      }
    } int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
      switch (S.charAt(i)) {
        case '1':
          K -= 1;
          if (K > 0) continue;
          println('1');
          return;
        
        default:
          println(S.charAt(i));
          return;
      }
    } {
      switch (S.charAt(i)) {
        case '1':
          K -= 1;
          if (K > 0) continue;
          println('1');
          return;
        
        default:
          println(S.charAt(i));
          return;
      }
    } switch (S.charAt(i)) {
        case '1':
          K -= 1;
          if (K > 0) continue;
          println('1');
          return;
        
        default:
          println(S.charAt(i));
          return;
      } S.charAt(i) S.charAt S i case '1': '1' case '1': K -= 1 K 1 if (K > 0) continue; K > 0 K 0 continue; println('1') println '1' return; default: default: println(S.charAt(i)) println S.charAt(i) S.charAt S i return; String[] args args /* 以下、標準出力用関数 */
  static public void print(byte what) { System.out.print(what); System.out.flush(); } print { System.out.print(what); System.out.flush(); } System.out.print(what) System.out.print System.out System System.out what System.out.flush() System.out.flush System.out System System.out byte what what static public void print(boolean what) { System.out.print(what); System.out.flush(); } print { System.out.print(what); System.out.flush(); } System.out.print(what) System.out.print System.out System System.out what System.out.flush() System.out.flush System.out System System.out boolean what what static public void print(char what) { System.out.print(what); System.out.flush(); } print { System.out.print(what); System.out.flush(); } System.out.print(what) System.out.print System.out System System.out what System.out.flush() System.out.flush System.out System System.out char what what static public void print(int what) { System.out.print(what); System.out.flush(); } print { System.out.print(what); System.out.flush(); } System.out.print(what) System.out.print System.out System System.out what System.out.flush() System.out.flush System.out System System.out int what what static public void print(long what) { System.out.print(what); System.out.flush(); } print { System.out.print(what); System.out.flush(); } System.out.print(what) System.out.print System.out System System.out what System.out.flush() System.out.flush System.out System System.out long what what static public void print(float what) { System.out.print(what); System.out.flush(); } print { System.out.print(what); System.out.flush(); } System.out.print(what) System.out.print System.out System System.out what System.out.flush() System.out.flush System.out System System.out float what what static public void print(double what) { System.out.print(what); System.out.flush(); } print { System.out.print(what); System.out.flush(); } System.out.print(what) System.out.print System.out System System.out what System.out.flush() System.out.flush System.out System System.out double what what static public void print(String what) { System.out.print(what); System.out.flush(); } print { System.out.print(what); System.out.flush(); } System.out.print(what) System.out.print System.out System System.out what System.out.flush() System.out.flush System.out System System.out String what what static public void print(Object... variables) { StringBuilder sb = new StringBuilder(); for (Object o : variables) { if (sb.length() != 0) { sb.append(" "); } if (o == null) { sb.append("null"); } else { sb.append(o.toString()); } } System.out.print(sb.toString()); } print { StringBuilder sb = new StringBuilder(); for (Object o : variables) { if (sb.length() != 0) { sb.append(" "); } if (o == null) { sb.append("null"); } else { sb.append(o.toString()); } } System.out.print(sb.toString()); } StringBuilder sb = new StringBuilder(); sb new StringBuilder() for (Object o : variables) { if (sb.length() != 0) { sb.append(" "); } if (o == null) { sb.append("null"); } else { sb.append(o.toString()); } } Object o variables { if (sb.length() != 0) { sb.append(" "); } if (o == null) { sb.append("null"); } else { sb.append(o.toString()); } } { if (sb.length() != 0) { sb.append(" "); } if (o == null) { sb.append("null"); } else { sb.append(o.toString()); } } if (sb.length() != 0) { sb.append(" "); } sb.length() != 0 sb.length() sb.length sb 0 { sb.append(" "); } sb.append(" ") sb.append sb " " if (o == null) { sb.append("null"); } else { sb.append(o.toString()); } o == null o null { sb.append("null"); } sb.append("null") sb.append sb "null" { sb.append(o.toString()); } sb.append(o.toString()) sb.append sb o.toString() o.toString o System.out.print(sb.toString()) System.out.print System.out System System.out sb.toString() sb.toString sb Object... variables variables static public void println() { System.out.println(); } println { System.out.println(); } System.out.println() System.out.println System.out System System.out static public void println(byte what) { System.out.println(what); System.out.flush(); } println { System.out.println(what); System.out.flush(); } System.out.println(what) System.out.println System.out System System.out what System.out.flush() System.out.flush System.out System System.out byte what what static public void println(boolean what) { System.out.println(what); System.out.flush(); } println { System.out.println(what); System.out.flush(); } System.out.println(what) System.out.println System.out System System.out what System.out.flush() System.out.flush System.out System System.out boolean what what static public void println(char what) { System.out.println(what); System.out.flush(); } println { System.out.println(what); System.out.flush(); } System.out.println(what) System.out.println System.out System System.out what System.out.flush() System.out.flush System.out System System.out char what what static public void println(int what) { System.out.println(what); System.out.flush(); } println { System.out.println(what); System.out.flush(); } System.out.println(what) System.out.println System.out System System.out what System.out.flush() System.out.flush System.out System System.out int what what static public void println(long what) { System.out.println(what); System.out.flush(); } println { System.out.println(what); System.out.flush(); } System.out.println(what) System.out.println System.out System System.out what System.out.flush() System.out.flush System.out System System.out long what what static public void println(float what) { System.out.println(what); System.out.flush(); } println { System.out.println(what); System.out.flush(); } System.out.println(what) System.out.println System.out System System.out what System.out.flush() System.out.flush System.out System System.out float what what static public void println(double what) { System.out.println(what); System.out.flush(); } println { System.out.println(what); System.out.flush(); } System.out.println(what) System.out.println System.out System System.out what System.out.flush() System.out.flush System.out System System.out double what what static public void println(String what) { System.out.println(what); System.out.flush(); } println { System.out.println(what); System.out.flush(); } System.out.println(what) System.out.println System.out System System.out what System.out.flush() System.out.flush System.out System System.out String what what static public void println(Object... variables) { print(variables); println(); } println { print(variables); println(); } print(variables) print variables println() println Object... variables variables static public void println(Object what) { if (what == null) { System.out.println("null"); } else if (what.getClass().isArray()) { printArray(what); } else { System.out.println(what.toString()); System.out.flush(); } } println { if (what == null) { System.out.println("null"); } else if (what.getClass().isArray()) { printArray(what); } else { System.out.println(what.toString()); System.out.flush(); } } if (what == null) { System.out.println("null"); } else if (what.getClass().isArray()) { printArray(what); } else { System.out.println(what.toString()); System.out.flush(); } what == null what null { System.out.println("null"); } System.out.println("null") System.out.println System.out System System.out "null" if (what.getClass().isArray()) { printArray(what); } else { System.out.println(what.toString()); System.out.flush(); } what.getClass().isArray() what.getClass().isArray what.getClass() what.getClass what { printArray(what); } printArray(what) printArray what { System.out.println(what.toString()); System.out.flush(); } System.out.println(what.toString()) System.out.println System.out System System.out what.toString() what.toString what System.out.flush() System.out.flush System.out System System.out Object what what static public void printArray(Object what) { if (what == null) { System.out.println("null"); } else { String name = what.getClass().getName(); if (name.charAt(0) == '[') { switch (name.charAt(1)) { case '[': System.out.println(what); break; case 'L': Object poo[] = (Object[]) what; for (int i = 0; i < poo.length; i++) { if (poo[i] instanceof String) { System.out.println("[" + i + "] \"" + poo[i] + "\""); } else { System.out.println("[" + i + "] " + poo[i]); } } break; case 'Z': boolean zz[] = (boolean[]) what; for (int i = 0; i < zz.length; i++) { System.out.println("[" + i + "] " + zz[i]); } break; case 'B': byte bb[] = (byte[]) what; for (int i = 0; i < bb.length; i++) { System.out.println("[" + i + "] " + bb[i]); } break; case 'C': char cc[] = (char[]) what; for (int i = 0; i < cc.length; i++) { System.out.println("[" + i + "] '" + cc[i] + "'"); } break; case 'I': int ii[] = (int[]) what; for (int i = 0; i < ii.length; i++) { System.out.println("[" + i + "] " + ii[i]); } break; case 'J': long jj[] = (long[]) what; for (int i = 0; i < jj.length; i++) { System.out.println("[" + i + "] " + jj[i]); } break; case 'F': float ff[] = (float[]) what; for (int i = 0; i < ff.length; i++) { System.out.println("[" + i + "] " + ff[i]); } break; case 'D': double dd[] = (double[]) what; for (int i = 0; i < dd.length; i++) { System.out.println("[" + i + "] " + dd[i]); } break; default: System.out.println(what); } } else { System.out.println(what); } } System.out.flush(); } printArray { if (what == null) { System.out.println("null"); } else { String name = what.getClass().getName(); if (name.charAt(0) == '[') { switch (name.charAt(1)) { case '[': System.out.println(what); break; case 'L': Object poo[] = (Object[]) what; for (int i = 0; i < poo.length; i++) { if (poo[i] instanceof String) { System.out.println("[" + i + "] \"" + poo[i] + "\""); } else { System.out.println("[" + i + "] " + poo[i]); } } break; case 'Z': boolean zz[] = (boolean[]) what; for (int i = 0; i < zz.length; i++) { System.out.println("[" + i + "] " + zz[i]); } break; case 'B': byte bb[] = (byte[]) what; for (int i = 0; i < bb.length; i++) { System.out.println("[" + i + "] " + bb[i]); } break; case 'C': char cc[] = (char[]) what; for (int i = 0; i < cc.length; i++) { System.out.println("[" + i + "] '" + cc[i] + "'"); } break; case 'I': int ii[] = (int[]) what; for (int i = 0; i < ii.length; i++) { System.out.println("[" + i + "] " + ii[i]); } break; case 'J': long jj[] = (long[]) what; for (int i = 0; i < jj.length; i++) { System.out.println("[" + i + "] " + jj[i]); } break; case 'F': float ff[] = (float[]) what; for (int i = 0; i < ff.length; i++) { System.out.println("[" + i + "] " + ff[i]); } break; case 'D': double dd[] = (double[]) what; for (int i = 0; i < dd.length; i++) { System.out.println("[" + i + "] " + dd[i]); } break; default: System.out.println(what); } } else { System.out.println(what); } } System.out.flush(); } if (what == null) { System.out.println("null"); } else { String name = what.getClass().getName(); if (name.charAt(0) == '[') { switch (name.charAt(1)) { case '[': System.out.println(what); break; case 'L': Object poo[] = (Object[]) what; for (int i = 0; i < poo.length; i++) { if (poo[i] instanceof String) { System.out.println("[" + i + "] \"" + poo[i] + "\""); } else { System.out.println("[" + i + "] " + poo[i]); } } break; case 'Z': boolean zz[] = (boolean[]) what; for (int i = 0; i < zz.length; i++) { System.out.println("[" + i + "] " + zz[i]); } break; case 'B': byte bb[] = (byte[]) what; for (int i = 0; i < bb.length; i++) { System.out.println("[" + i + "] " + bb[i]); } break; case 'C': char cc[] = (char[]) what; for (int i = 0; i < cc.length; i++) { System.out.println("[" + i + "] '" + cc[i] + "'"); } break; case 'I': int ii[] = (int[]) what; for (int i = 0; i < ii.length; i++) { System.out.println("[" + i + "] " + ii[i]); } break; case 'J': long jj[] = (long[]) what; for (int i = 0; i < jj.length; i++) { System.out.println("[" + i + "] " + jj[i]); } break; case 'F': float ff[] = (float[]) what; for (int i = 0; i < ff.length; i++) { System.out.println("[" + i + "] " + ff[i]); } break; case 'D': double dd[] = (double[]) what; for (int i = 0; i < dd.length; i++) { System.out.println("[" + i + "] " + dd[i]); } break; default: System.out.println(what); } } else { System.out.println(what); } } what == null what null { System.out.println("null"); } System.out.println("null") System.out.println System.out System System.out "null" { String name = what.getClass().getName(); if (name.charAt(0) == '[') { switch (name.charAt(1)) { case '[': System.out.println(what); break; case 'L': Object poo[] = (Object[]) what; for (int i = 0; i < poo.length; i++) { if (poo[i] instanceof String) { System.out.println("[" + i + "] \"" + poo[i] + "\""); } else { System.out.println("[" + i + "] " + poo[i]); } } break; case 'Z': boolean zz[] = (boolean[]) what; for (int i = 0; i < zz.length; i++) { System.out.println("[" + i + "] " + zz[i]); } break; case 'B': byte bb[] = (byte[]) what; for (int i = 0; i < bb.length; i++) { System.out.println("[" + i + "] " + bb[i]); } break; case 'C': char cc[] = (char[]) what; for (int i = 0; i < cc.length; i++) { System.out.println("[" + i + "] '" + cc[i] + "'"); } break; case 'I': int ii[] = (int[]) what; for (int i = 0; i < ii.length; i++) { System.out.println("[" + i + "] " + ii[i]); } break; case 'J': long jj[] = (long[]) what; for (int i = 0; i < jj.length; i++) { System.out.println("[" + i + "] " + jj[i]); } break; case 'F': float ff[] = (float[]) what; for (int i = 0; i < ff.length; i++) { System.out.println("[" + i + "] " + ff[i]); } break; case 'D': double dd[] = (double[]) what; for (int i = 0; i < dd.length; i++) { System.out.println("[" + i + "] " + dd[i]); } break; default: System.out.println(what); } } else { System.out.println(what); } } String name = what.getClass().getName(); name what.getClass().getName() what.getClass().getName what.getClass() what.getClass what if (name.charAt(0) == '[') { switch (name.charAt(1)) { case '[': System.out.println(what); break; case 'L': Object poo[] = (Object[]) what; for (int i = 0; i < poo.length; i++) { if (poo[i] instanceof String) { System.out.println("[" + i + "] \"" + poo[i] + "\""); } else { System.out.println("[" + i + "] " + poo[i]); } } break; case 'Z': boolean zz[] = (boolean[]) what; for (int i = 0; i < zz.length; i++) { System.out.println("[" + i + "] " + zz[i]); } break; case 'B': byte bb[] = (byte[]) what; for (int i = 0; i < bb.length; i++) { System.out.println("[" + i + "] " + bb[i]); } break; case 'C': char cc[] = (char[]) what; for (int i = 0; i < cc.length; i++) { System.out.println("[" + i + "] '" + cc[i] + "'"); } break; case 'I': int ii[] = (int[]) what; for (int i = 0; i < ii.length; i++) { System.out.println("[" + i + "] " + ii[i]); } break; case 'J': long jj[] = (long[]) what; for (int i = 0; i < jj.length; i++) { System.out.println("[" + i + "] " + jj[i]); } break; case 'F': float ff[] = (float[]) what; for (int i = 0; i < ff.length; i++) { System.out.println("[" + i + "] " + ff[i]); } break; case 'D': double dd[] = (double[]) what; for (int i = 0; i < dd.length; i++) { System.out.println("[" + i + "] " + dd[i]); } break; default: System.out.println(what); } } else { System.out.println(what); } name.charAt(0) == '[' name.charAt(0) name.charAt name 0 '[' { switch (name.charAt(1)) { case '[': System.out.println(what); break; case 'L': Object poo[] = (Object[]) what; for (int i = 0; i < poo.length; i++) { if (poo[i] instanceof String) { System.out.println("[" + i + "] \"" + poo[i] + "\""); } else { System.out.println("[" + i + "] " + poo[i]); } } break; case 'Z': boolean zz[] = (boolean[]) what; for (int i = 0; i < zz.length; i++) { System.out.println("[" + i + "] " + zz[i]); } break; case 'B': byte bb[] = (byte[]) what; for (int i = 0; i < bb.length; i++) { System.out.println("[" + i + "] " + bb[i]); } break; case 'C': char cc[] = (char[]) what; for (int i = 0; i < cc.length; i++) { System.out.println("[" + i + "] '" + cc[i] + "'"); } break; case 'I': int ii[] = (int[]) what; for (int i = 0; i < ii.length; i++) { System.out.println("[" + i + "] " + ii[i]); } break; case 'J': long jj[] = (long[]) what; for (int i = 0; i < jj.length; i++) { System.out.println("[" + i + "] " + jj[i]); } break; case 'F': float ff[] = (float[]) what; for (int i = 0; i < ff.length; i++) { System.out.println("[" + i + "] " + ff[i]); } break; case 'D': double dd[] = (double[]) what; for (int i = 0; i < dd.length; i++) { System.out.println("[" + i + "] " + dd[i]); } break; default: System.out.println(what); } } switch (name.charAt(1)) { case '[': System.out.println(what); break; case 'L': Object poo[] = (Object[]) what; for (int i = 0; i < poo.length; i++) { if (poo[i] instanceof String) { System.out.println("[" + i + "] \"" + poo[i] + "\""); } else { System.out.println("[" + i + "] " + poo[i]); } } break; case 'Z': boolean zz[] = (boolean[]) what; for (int i = 0; i < zz.length; i++) { System.out.println("[" + i + "] " + zz[i]); } break; case 'B': byte bb[] = (byte[]) what; for (int i = 0; i < bb.length; i++) { System.out.println("[" + i + "] " + bb[i]); } break; case 'C': char cc[] = (char[]) what; for (int i = 0; i < cc.length; i++) { System.out.println("[" + i + "] '" + cc[i] + "'"); } break; case 'I': int ii[] = (int[]) what; for (int i = 0; i < ii.length; i++) { System.out.println("[" + i + "] " + ii[i]); } break; case 'J': long jj[] = (long[]) what; for (int i = 0; i < jj.length; i++) { System.out.println("[" + i + "] " + jj[i]); } break; case 'F': float ff[] = (float[]) what; for (int i = 0; i < ff.length; i++) { System.out.println("[" + i + "] " + ff[i]); } break; case 'D': double dd[] = (double[]) what; for (int i = 0; i < dd.length; i++) { System.out.println("[" + i + "] " + dd[i]); } break; default: System.out.println(what); } name.charAt(1) name.charAt name 1 case '[': '[' case '[': System.out.println(what) System.out.println System.out System System.out what break; case 'L': 'L' case 'L': Object poo[] = (Object[]) what; poo (Object[]) what for (int i = 0; i < poo.length; i++) { if (poo[i] instanceof String) { System.out.println("[" + i + "] \"" + poo[i] + "\""); } else { System.out.println("[" + i + "] " + poo[i]); } } int i = 0; int i = 0; i 0 i < poo.length i poo.length poo poo.length i++ i++ i { if (poo[i] instanceof String) { System.out.println("[" + i + "] \"" + poo[i] + "\""); } else { System.out.println("[" + i + "] " + poo[i]); } } { if (poo[i] instanceof String) { System.out.println("[" + i + "] \"" + poo[i] + "\""); } else { System.out.println("[" + i + "] " + poo[i]); } } if (poo[i] instanceof String) { System.out.println("[" + i + "] \"" + poo[i] + "\""); } else { System.out.println("[" + i + "] " + poo[i]); } poo[i] instanceof String poo[i] poo i String { System.out.println("[" + i + "] \"" + poo[i] + "\""); } System.out.println("[" + i + "] \"" + poo[i] + "\"") System.out.println System.out System System.out "[" + i + "] \"" + poo[i] + "\"" poo[i] "] \"" "[" + i + "] \"" + poo[i] + "\"" "[" i "] \"" poo[i] poo i "\"" { System.out.println("[" + i + "] " + poo[i]); } System.out.println("[" + i + "] " + poo[i]) System.out.println System.out System System.out "[" + i + "] " + poo[i] "] " "[" + i + "] " + poo[i] "[" i "] " poo[i] poo i break; case 'Z': 'Z' case 'Z': boolean zz[] = (boolean[]) what; zz (boolean[]) what for (int i = 0; i < zz.length; i++) { System.out.println("[" + i + "] " + zz[i]); } int i = 0; int i = 0; i 0 i < zz.length i zz.length zz zz.length i++ i++ i { System.out.println("[" + i + "] " + zz[i]); } { System.out.println("[" + i + "] " + zz[i]); } System.out.println("[" + i + "] " + zz[i]) System.out.println System.out System System.out "[" + i + "] " + zz[i] "] " "[" + i + "] " + zz[i] "[" i "] " zz[i] zz i break; case 'B': 'B' case 'B': byte bb[] = (byte[]) what; bb (byte[]) what for (int i = 0; i < bb.length; i++) { System.out.println("[" + i + "] " + bb[i]); } int i = 0; int i = 0; i 0 i < bb.length i bb.length bb bb.length i++ i++ i { System.out.println("[" + i + "] " + bb[i]); } { System.out.println("[" + i + "] " + bb[i]); } System.out.println("[" + i + "] " + bb[i]) System.out.println System.out System System.out "[" + i + "] " + bb[i] "] " "[" + i + "] " + bb[i] "[" i "] " bb[i] bb i break; case 'C': 'C' case 'C': char cc[] = (char[]) what; cc (char[]) what for (int i = 0; i < cc.length; i++) { System.out.println("[" + i + "] '" + cc[i] + "'"); } int i = 0; int i = 0; i 0 i < cc.length i cc.length cc cc.length i++ i++ i { System.out.println("[" + i + "] '" + cc[i] + "'"); } { System.out.println("[" + i + "] '" + cc[i] + "'"); } System.out.println("[" + i + "] '" + cc[i] + "'") System.out.println System.out System System.out "[" + i + "] '" + cc[i] + "'" cc[i] "] '" "[" + i + "] '" + cc[i] + "'" "[" i "] '" cc[i] cc i "'" break; case 'I': 'I' case 'I': int ii[] = (int[]) what; ii (int[]) what for (int i = 0; i < ii.length; i++) { System.out.println("[" + i + "] " + ii[i]); } int i = 0; int i = 0; i 0 i < ii.length i ii.length ii ii.length i++ i++ i { System.out.println("[" + i + "] " + ii[i]); } { System.out.println("[" + i + "] " + ii[i]); } System.out.println("[" + i + "] " + ii[i]) System.out.println System.out System System.out "[" + i + "] " + ii[i] "] " "[" + i + "] " + ii[i] "[" i "] " ii[i] ii i break; case 'J': 'J' case 'J': long jj[] = (long[]) what; jj (long[]) what for (int i = 0; i < jj.length; i++) { System.out.println("[" + i + "] " + jj[i]); } int i = 0; int i = 0; i 0 i < jj.length i jj.length jj jj.length i++ i++ i { System.out.println("[" + i + "] " + jj[i]); } { System.out.println("[" + i + "] " + jj[i]); } System.out.println("[" + i + "] " + jj[i]) System.out.println System.out System System.out "[" + i + "] " + jj[i] "] " "[" + i + "] " + jj[i] "[" i "] " jj[i] jj i break; case 'F': 'F' case 'F': float ff[] = (float[]) what; ff (float[]) what for (int i = 0; i < ff.length; i++) { System.out.println("[" + i + "] " + ff[i]); } int i = 0; int i = 0; i 0 i < ff.length i ff.length ff ff.length i++ i++ i { System.out.println("[" + i + "] " + ff[i]); } { System.out.println("[" + i + "] " + ff[i]); } System.out.println("[" + i + "] " + ff[i]) System.out.println System.out System System.out "[" + i + "] " + ff[i] "] " "[" + i + "] " + ff[i] "[" i "] " ff[i] ff i break; case 'D': 'D' case 'D': double dd[] = (double[]) what; dd (double[]) what for (int i = 0; i < dd.length; i++) { System.out.println("[" + i + "] " + dd[i]); } int i = 0; int i = 0; i 0 i < dd.length i dd.length dd dd.length i++ i++ i { System.out.println("[" + i + "] " + dd[i]); } { System.out.println("[" + i + "] " + dd[i]); } System.out.println("[" + i + "] " + dd[i]) System.out.println System.out System System.out "[" + i + "] " + dd[i] "] " "[" + i + "] " + dd[i] "[" i "] " dd[i] dd i break; default: default: System.out.println(what) System.out.println System.out System System.out what { System.out.println(what); } System.out.println(what) System.out.println System.out System System.out what System.out.flush() System.out.flush System.out System System.out Object what what
class Main {
  public static void main(String[] args) {
    java.util.Scanner sc = new java.util.Scanner(System.in);
    String S = sc.next();
    long K = sc.nextLong();
    for (int i = 0; i < S.length(); i++) {
      switch (S.charAt(i)) {
        case '1':
          K -= 1;
          if (K > 0) continue;
          println('1');
          return;
        
        default:
          println(S.charAt(i));
          return;
      }
    }
  }

  /* 以下、標準出力用関数 */
  static public void print(byte what) { System.out.print(what); System.out.flush(); }
  static public void print(boolean what) { System.out.print(what); System.out.flush(); }
  static public void print(char what) { System.out.print(what); System.out.flush(); }
  static public void print(int what) { System.out.print(what); System.out.flush(); }
  static public void print(long what) { System.out.print(what); System.out.flush(); }
  static public void print(float what) { System.out.print(what); System.out.flush(); }
  static public void print(double what) { System.out.print(what); System.out.flush(); }
  static public void print(String what) { System.out.print(what); System.out.flush(); }
  static public void print(Object... variables) { StringBuilder sb = new StringBuilder(); for (Object o : variables) { if (sb.length() != 0) { sb.append(" "); } if (o == null) { sb.append("null"); } else { sb.append(o.toString()); } } System.out.print(sb.toString()); }
  static public void println() { System.out.println(); }
  static public void println(byte what) { System.out.println(what); System.out.flush(); }
  static public void println(boolean what) { System.out.println(what); System.out.flush(); }
  static public void println(char what) { System.out.println(what); System.out.flush(); }
  static public void println(int what) { System.out.println(what); System.out.flush(); }
  static public void println(long what) { System.out.println(what); System.out.flush(); }
  static public void println(float what) { System.out.println(what); System.out.flush(); }
  static public void println(double what) { System.out.println(what); System.out.flush(); }
  static public void println(String what) { System.out.println(what); System.out.flush(); }
  static public void println(Object... variables) { print(variables); println(); }
  static public void println(Object what) { if (what == null) { System.out.println("null"); } else if (what.getClass().isArray()) { printArray(what); } else { System.out.println(what.toString()); System.out.flush(); } }
  static public void printArray(Object what) { if (what == null) { System.out.println("null"); } else { String name = what.getClass().getName(); if (name.charAt(0) == '[') { switch (name.charAt(1)) { case '[': System.out.println(what); break; case 'L': Object poo[] = (Object[]) what; for (int i = 0; i < poo.length; i++) { if (poo[i] instanceof String) { System.out.println("[" + i + "] \"" + poo[i] + "\""); } else { System.out.println("[" + i + "] " + poo[i]); } } break; case 'Z': boolean zz[] = (boolean[]) what; for (int i = 0; i < zz.length; i++) { System.out.println("[" + i + "] " + zz[i]); } break; case 'B': byte bb[] = (byte[]) what; for (int i = 0; i < bb.length; i++) { System.out.println("[" + i + "] " + bb[i]); } break; case 'C': char cc[] = (char[]) what; for (int i = 0; i < cc.length; i++) { System.out.println("[" + i + "] '" + cc[i] + "'"); } break; case 'I': int ii[] = (int[]) what; for (int i = 0; i < ii.length; i++) { System.out.println("[" + i + "] " + ii[i]); } break; case 'J': long jj[] = (long[]) what; for (int i = 0; i < jj.length; i++) { System.out.println("[" + i + "] " + jj[i]); } break; case 'F': float ff[] = (float[]) what; for (int i = 0; i < ff.length; i++) { System.out.println("[" + i + "] " + ff[i]); } break; case 'D': double dd[] = (double[]) what; for (int i = 0; i < dd.length; i++) { System.out.println("[" + i + "] " + dd[i]); } break; default: System.out.println(what); } } else { System.out.println(what); } } System.out.flush(); }
}
