#define STACKSIZE 10
#include <iostream>
using namespace std;
class Stack
	{

	public:
		Stack(){sp=-1;}
		void push(int);
		int pop(void);
	
	private:
		int sp;
		int list[STACKSIZE];
		bool isFull(void);
		bool isEmpty(void);

};

bool Stack::isFull(void)
{ 
	if (sp>=STACKSIZE-1)
        return true;
	else
		return false;
}
bool Stack::isEmpty(void)
{ 
	if (sp<0)
        return true;
	else
		return false;
}
void Stack::push(int x)
{
	if (!isFull())
    {
		sp++;
	    list[sp]=x;
    }
	else
				cout<<"is full"; //debug should this be here?
}
int Stack::pop(void)
{
	if (!isEmpty())
	{
	    int temp = list[sp];
		sp--;
		return temp;
	}
	else 
	{
		cout<<"is empty"; //debug should this be here?
		return -1;
	}
}


int main(void)
{

	Stack myStack;
	Stack myOtherStack;
	myOtherStack.push(1111);
	myStack.push(2);
	myStack.push(3);
	myStack.push(4);
	myStack.push(5);
	myStack.push(6);
	myStack.push(1);
	myStack.push(2);
	myStack.push(3);
	myStack.push(4);
	myStack.push(5);
	myStack.push(6);
	cout<<myOtherStack.pop();
	cout<<myStack.pop();
	cout<<myStack.pop();
	cout<<myStack.pop();
	cout<<myStack.pop();
	cout<<myStack.pop();
	cout<<myStack.pop();
	cout<<myStack.pop();
	cout<<myStack.pop();
	cout<<myStack.pop();
	cout<<myStack.pop();
	cout<<myStack.pop();
	cout<<myStack.pop();
	cout<<myStack.pop();
	cout<<myStack.pop();
	cout<<myStack.pop();
	return 0;
}