int main() {
    char phonenumber[11];
    int position;

    scanf("%11s %d", phonenumber, &position);
    if (position > 9 || position < -1) {
        printf("ERROR\n");
        return 1;
    }

    if (position == -1) {
        printf("%s\n", phonenumber);
    }
    else {
        printf("%c\n", phonenumber[position]);
    }
    return 0;
}