#include <stdio.h>
#include <stdlib.h>

int main() {
    char phone[11];
    int i;

    scanf("%10s", phone); 

    while (scanf("%d", &i) != EOF) { 
        if (i == -1){
        printf("%s\n", phone);
        return 0;
    }
    if (i < -1 ){
        printf("ERROR\n");
        return 1;
    }
    if (i > 9 ){
        printf("ERROR\n");
        return 1;
    }
    else{
        printf("%c\n", phone[i]);
        return 0;

    }
    
}
return 0;
}
allow users to keep entering ints in a new line and displays the output