int main(){
        char phone[11];
        int num;
        scanf("%10s %d", phone, num);
        if (num == -1){
                printf(phone);
                return 0;
        } else if (0 <= num <= 9) {
                printf(phone[num]);
                return 0;
        } else {
                printf("ERROR");
                return 1;
        }
}