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

#include "intstack.h"



void stack_init(IntStack *s) {
    // TODO: implement this function
    (void) s;
}

void stack_push(IntStack *s, int value) {
    // TODO: implement this function
    (void) s;
    (void) value;
}

int stack_pop(IntStack *s) {
    // TODO: implement this function
    (void) s;
    return 0;
}

void stack_free(IntStack *s) {
    // TODO: implement this function
    (void) s;
}


int main(void) {
    IntStack s;
    stack_init(&s);
    char tok[20];
    while (scanf("%19s", tok) == 1) {
        if (strcmp(tok, "p") == 0) { printf("%d\n", stack_pop(&s)); }
        else { stack_push(&s, atoi(tok)); }
    }
    stack_free(&s);
    return 0;
}
