int main() {
    char phone[11];
    scanf("%10s", phone);
    int x;
    int error = 0;

    scanf("%d", &x);

    while (x != EOF) {
        if (x == -1) {
            printf("%s\n", phone);
        }
        else if (x >= 0 && x <= 9) {
            printf("%c\n", *(phone + x));
        }
        else {
            printf("ERROR\n");
            error = 1;
        }

        scanf("%d", &x);
    }

    return error;
exit the while loop once the input stream is closed