var stack = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
var head = -1;
function isEmpty() {
return head == -1;
}
function push(x) {
if (head + 1 >= stack.length) {
console.log("Stack overflow");
return;
}
stack[head++] = x;
}
function pop(x) {
if (!isEmpty()) {
return stack[head--];
}
console.log("EmptyStack");
}