import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    static int[] w = new int[100010];
    static int[] v = new int[100010];
    static int[][] dp = new int[110][100010];
    static int k;

    static int chmin(int a, int b) {
        if (a > b) {
            a = b;
            return a;
        }
        return a;
    }

    static int chmax(int a, int b) {
        if (a < b) {
            a = b;
            return a;
        }
        return a;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long n = sc.nextLong();
        char[] array = s.toCharArray();
        char num = '1';
        for (int i = 0; i < n; i++) {
            if (array[i] != '1') {
                num = array[i];
                break;
            }
        }
        if (s.charAt(0) == 1 && n == 1) {
            System.out.println(1);
        } else if (s.charAt(0) == '1' && n > 1) {
            System.out.println(num);
        } else {
            System.out.println(s.charAt(0));
        }

    }
} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {
    static int[] w = new int[100010];
    static int[] v = new int[100010];
    static int[][] dp = new int[110][100010];
    static int k;

    static int chmin(int a, int b) {
        if (a > b) {
            a = b;
            return a;
        }
        return a;
    }

    static int chmax(int a, int b) {
        if (a < b) {
            a = b;
            return a;
        }
        return a;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long n = sc.nextLong();
        char[] array = s.toCharArray();
        char num = '1';
        for (int i = 0; i < n; i++) {
            if (array[i] != '1') {
                num = array[i];
                break;
            }
        }
        if (s.charAt(0) == 1 && n == 1) {
            System.out.println(1);
        } else if (s.charAt(0) == '1' && n > 1) {
            System.out.println(num);
        } else {
            System.out.println(s.charAt(0));
        }

    }
} Main static int[] w = new int[100010]; w new int[100010] 100010 static int[] v = new int[100010]; v new int[100010] 100010 static int[][] dp = new int[110][100010]; dp new int[110][100010] 110 100010 static int k; k static int chmin(int a, int b) {
        if (a > b) {
            a = b;
            return a;
        }
        return a;
    } chmin {
        if (a > b) {
            a = b;
            return a;
        }
        return a;
    } if (a > b) {
            a = b;
            return a;
        } a > b a b {
            a = b;
            return a;
        } a = b a b return a; a return a; a int a a int b b static int chmax(int a, int b) {
        if (a < b) {
            a = b;
            return a;
        }
        return a;
    } chmax {
        if (a < b) {
            a = b;
            return a;
        }
        return a;
    } if (a < b) {
            a = b;
            return a;
        } a < b a b {
            a = b;
            return a;
        } a = b a b return a; a return a; a int a a int b b public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long n = sc.nextLong();
        char[] array = s.toCharArray();
        char num = '1';
        for (int i = 0; i < n; i++) {
            if (array[i] != '1') {
                num = array[i];
                break;
            }
        }
        if (s.charAt(0) == 1 && n == 1) {
            System.out.println(1);
        } else if (s.charAt(0) == '1' && n > 1) {
            System.out.println(num);
        } else {
            System.out.println(s.charAt(0));
        }

    } main {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long n = sc.nextLong();
        char[] array = s.toCharArray();
        char num = '1';
        for (int i = 0; i < n; i++) {
            if (array[i] != '1') {
                num = array[i];
                break;
            }
        }
        if (s.charAt(0) == 1 && n == 1) {
            System.out.println(1);
        } else if (s.charAt(0) == '1' && n > 1) {
            System.out.println(num);
        } else {
            System.out.println(s.charAt(0));
        }

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc long n = sc.nextLong(); n sc.nextLong() sc.nextLong sc char[] array = s.toCharArray(); array s.toCharArray() s.toCharArray s char num = '1'; num '1' for (int i = 0; i < n; i++) {
            if (array[i] != '1') {
                num = array[i];
                break;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            if (array[i] != '1') {
                num = array[i];
                break;
            }
        } {
            if (array[i] != '1') {
                num = array[i];
                break;
            }
        } if (array[i] != '1') {
                num = array[i];
                break;
            } array[i] != '1' array[i] array i '1' {
                num = array[i];
                break;
            } num = array[i] num array[i] array i break; if (s.charAt(0) == 1 && n == 1) {
            System.out.println(1);
        } else if (s.charAt(0) == '1' && n > 1) {
            System.out.println(num);
        } else {
            System.out.println(s.charAt(0));
        } s.charAt(0) == 1 && n == 1 s.charAt(0) == 1 s.charAt(0) s.charAt s 0 1 n == 1 n 1 {
            System.out.println(1);
        } System.out.println(1) System.out.println System.out System System.out 1 if (s.charAt(0) == '1' && n > 1) {
            System.out.println(num);
        } else {
            System.out.println(s.charAt(0));
        } s.charAt(0) == '1' && n > 1 s.charAt(0) == '1' s.charAt(0) s.charAt s 0 '1' n > 1 n 1 {
            System.out.println(num);
        } System.out.println(num) System.out.println System.out System System.out num {
            System.out.println(s.charAt(0));
        } System.out.println(s.charAt(0)) System.out.println System.out System System.out s.charAt(0) s.charAt s 0 String[] args args public class Main {
    static int[] w = new int[100010];
    static int[] v = new int[100010];
    static int[][] dp = new int[110][100010];
    static int k;

    static int chmin(int a, int b) {
        if (a > b) {
            a = b;
            return a;
        }
        return a;
    }

    static int chmax(int a, int b) {
        if (a < b) {
            a = b;
            return a;
        }
        return a;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long n = sc.nextLong();
        char[] array = s.toCharArray();
        char num = '1';
        for (int i = 0; i < n; i++) {
            if (array[i] != '1') {
                num = array[i];
                break;
            }
        }
        if (s.charAt(0) == 1 && n == 1) {
            System.out.println(1);
        } else if (s.charAt(0) == '1' && n > 1) {
            System.out.println(num);
        } else {
            System.out.println(s.charAt(0));
        }

    }
} public class Main {
    static int[] w = new int[100010];
    static int[] v = new int[100010];
    static int[][] dp = new int[110][100010];
    static int k;

    static int chmin(int a, int b) {
        if (a > b) {
            a = b;
            return a;
        }
        return a;
    }

    static int chmax(int a, int b) {
        if (a < b) {
            a = b;
            return a;
        }
        return a;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long n = sc.nextLong();
        char[] array = s.toCharArray();
        char num = '1';
        for (int i = 0; i < n; i++) {
            if (array[i] != '1') {
                num = array[i];
                break;
            }
        }
        if (s.charAt(0) == 1 && n == 1) {
            System.out.println(1);
        } else if (s.charAt(0) == '1' && n > 1) {
            System.out.println(num);
        } else {
            System.out.println(s.charAt(0));
        }

    }
} Main
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    static int[] w = new int[100010];
    static int[] v = new int[100010];
    static int[][] dp = new int[110][100010];
    static int k;

    static int chmin(int a, int b) {
        if (a > b) {
            a = b;
            return a;
        }
        return a;
    }

    static int chmax(int a, int b) {
        if (a < b) {
            a = b;
            return a;
        }
        return a;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long n = sc.nextLong();
        char[] array = s.toCharArray();
        char num = '1';
        for (int i = 0; i < n; i++) {
            if (array[i] != '1') {
                num = array[i];
                break;
            }
        }
        if (s.charAt(0) == 1 && n == 1) {
            System.out.println(1);
        } else if (s.charAt(0) == '1' && n > 1) {
            System.out.println(num);
        } else {
            System.out.println(s.charAt(0));
        }

    }
}
